diff options
author | Johan Wassberg <jocar@sunet.se> | 2022-11-01 11:15:22 +0100 |
---|---|---|
committer | Johan Wassberg <jocar@sunet.se> | 2022-11-01 11:15:22 +0100 |
commit | a06ab838933b615156ee80b1d278d541e83d9cfa (patch) | |
tree | da178f1a6a1f229f2b50e9bc7d0063aa9f3d87d6 /scripts/remove_entity.sh | |
parent | 5ea8c2d30b8bf9abe92febd99ea4aa840b7b4401 (diff) |
Use the same sed as when adding metadata
Diffstat (limited to 'scripts/remove_entity.sh')
-rwxr-xr-x | scripts/remove_entity.sh | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/scripts/remove_entity.sh b/scripts/remove_entity.sh index 2ab77bc7..11bd6852 100755 --- a/scripts/remove_entity.sh +++ b/scripts/remove_entity.sh @@ -49,28 +49,23 @@ if [ -r "$file" ]; then esac echo - if [ `uname -s` == "Darwin" ]; then - MacOSX=true - else - MacOSX=false - fi if (grep -q $entityidfn sp-with-simplesign); then - if ( $MacOSX ) ; then - sed -i "" "/\/$entityidfn/d" sp-with-simplesign - else - sed -i "/\/$entityidfn/d" sp-with-simplesign - fi + sed -i.bak "/\/$entityidfn/d" sp-with-simplesign + if [ -f sp-with-simplesign.bak ]; then + rm sp-with-simplesign.bak + fi + fi git rm $file grep $file *.mxml | sed 's/\(.*\.mxml\): <xi:include href=".*"\/>/\1/' | while read mxmlfile ; do - if ( $MacOSX ) ; then - sed -i "" "/\/$entityidfn/d" $mxmlfile - else - sed -i "/\/$entityidfn/d" $mxmlfile - fi + sed -i.bak "/\/$entityidfn/d" $mxmlfile + if [ -f $mxmlfile.bak ]; then + rm $mxmlfile.bak + fi done git diff + git status else error "File not found: $file" fi |