diff options
author | Björn Mattsson <Bjorn.Mattsson@bth.se> | 2018-02-02 10:46:58 +0100 |
---|---|---|
committer | Björn Mattsson <Bjorn.Mattsson@bth.se> | 2018-02-02 10:46:58 +0100 |
commit | e2729628f2b5d521dba3d991c10f2aac6478bda1 (patch) | |
tree | 2079fb0e33b475ab9565ea9a4ef121e292c31ef9 /scripts/remove_entity.sh | |
parent | 8a0c9b7c7018804c7089ff36e7709c077d18be89 (diff) |
Added script
Diffstat (limited to 'scripts/remove_entity.sh')
-rwxr-xr-x | scripts/remove_entity.sh | 29 |
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 + |