summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get-metadata.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/get-metadata.sh b/scripts/get-metadata.sh
index 71164cb6..16379681 100755
--- a/scripts/get-metadata.sh
+++ b/scripts/get-metadata.sh
@@ -68,7 +68,11 @@ entityid=`echo "$metadata" | sed -n 's/.*entityID=['\''"]\([^"]*\)['\''"].*/\1/p
entityidfn=`echo "$entityid" | sed 's;.*://;;' | sed 's/[^a-zwA-ZW0-9_.-]/-/g' | sed 's/$/.xml/'`
[ -n "$entityidfn" ] || error "Failed to generate filename from entityid $entityid"
-
+OLDFILE=$(find ../swamid-testing ../swamid-2.0 ../swamid-edugain -name $entityidfn | grep -v $xmldir)
+if [ -n "$OLDFILE" ]; then
+ echo "Moving $OLDFILE into $xmldir"
+ git mv $OLDFILE $entityidfn
+fi
[ -r "$entityidfn" ] && new=false || new=true
if $new ; then
echo -n "Save metadata into $entityidfn [Y/n]? "