Skip to content

Commit 5c58a5e

Browse files
committed
Add a backup-check to avoid reimporting apps.
1 parent a4451e8 commit 5c58a5e

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
3+
VERSION="$1"
4+
IMPORT_DIR="$2"
5+
TARGET_DIR="$3"
6+
APPS="$(< $4 )"
7+
8+
ret=0
9+
10+
for app in $APPS; do
11+
if [[ -d $TARGET_DIR/$app ]]; then
12+
ret=1
13+
echo "Trying to import application $app which already exists." 2>&1
14+
fi
15+
done
16+
17+
exit $ret
18+

0 commit comments

Comments
 (0)