summaryrefslogtreecommitdiff
path: root/scripts/remove_entity.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/remove_entity.sh')
-rwxr-xr-xscripts/remove_entity.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/remove_entity.sh b/scripts/remove_entity.sh
new file mode 100755
index 00000000..bc6546b0
--- /dev/null
+++ b/scripts/remove_entity.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+if [ -z "$1" ]; then
+ echo "$0 <Filename / part of to remove>"
+ exit
+fi
+
+echo "---------------------"
+grep $1 *.mxml sp-with-simplesign
+echo "---------------------"
+echo -n "OK to remove ? [Y/n]"
+read x
+case $x in
+ "Y"|"y"|"") ;;
+ *) exit 1 ;;
+esac
+
+echo
+if (grep -q $1 sp-with-simplesign); then
+ echo "Found in sp-with-simplesign"
+fi
+grep $1 *.mxml | sed 's/.*: <xi:include href="\(.*\)"\/>/\1/' | while read file ; do
+ git rm $file
+done
+
+grep $1 *.mxml | sed 's/\(.*\.mxml\): <xi:include href=".*"\/>/\1/' | while read file ; do
+ sed -i "/$1/d" $file
+done
+git diff
+