summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Wassberg <jocar@sunet.se>2022-10-04 15:56:25 +0200
committerJohan Wassberg <jocar@sunet.se>2022-10-04 15:56:25 +0200
commitacc4599cdf3a2a0de908908471896f2f54bdadd0 (patch)
tree4181c3a7f7d8d90b0a74d4a96b6e9c9c0359cb0d
parent636d46d4d2bba556977e2fdad9029b362a7cc10c (diff)
Don't leave files like swamid-sp-2.0.mxml'' around
-rwxr-xr-xscripts/get-metadata.sh11
1 files changed, 4 insertions, 7 deletions
diff --git a/scripts/get-metadata.sh b/scripts/get-metadata.sh
index 26534d3c..c3be62a4 100755
--- a/scripts/get-metadata.sh
+++ b/scripts/get-metadata.sh
@@ -22,12 +22,6 @@ EOF
exit 1
fi
-if [ `uname -s` == "Darwin" ]; then
- SEDI="sed -i '' "
-else
- SEDI="sed -i"
-fi
-
script_cwd=`dirname "$0"`
if test -d swamid-2.0 ; then
echo "Moving into swamid-2.0/"
@@ -90,7 +84,10 @@ case $x in
read x
case $x in
Y|y|"")
- $SEDI "s;^</md:EntitiesDescriptor>; <xi:include href=\"swamid-2.0/$entityidfn\"/>\n&;" ../swamid-sp-2.0.mxml
+ sed -i.bak "s;^</md:EntitiesDescriptor>; <xi:include href=\"swamid-2.0/$entityidfn\"/>\n&;" ../swamid-sp-2.0.mxml
+ if [ -f ../swamid-sp-2.0.mxml.bak ]; then
+ rm ../swamid-sp-2.0.mxml.bak
+ fi
echo --
tail -n 10 ../swamid-sp-2.0.mxml | sed 's/^/ /'
echo --