#!/bin/sh
# Remove the installed layout, but never a version the user has edited:
# only delete it when it still matches the packaged copy.
set -e

TARGET="$HOME/project/project-content/layouts/wireBender.json"

if [ -f "$TARGET" ]; then
  if cmp -s "$PWD/wireBender.json" "$TARGET"; then
    rm "$TARGET"
    echo "uninstalled: removed $TARGET"
  else
    echo "kept $TARGET: it differs from the packaged layout (local edits)"
  fi
else
  echo "nothing to remove: $TARGET not present"
fi