diff options
-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 |