Use pushd and popd instead of cd

This commit is contained in:
Weyert de Boer committed 2017-04-19 03:26:00 +01:00
1 parent 3e4f91a78d
commit f0e0e20496
1 file changed
+3 -3
+3 -3
View File
@@ -21,9 +21,9 @@ apps_clone_cmd() {
local NEW_CACHE_DIR="$DOKKU_ROOT/$NEW_APP/cache" local NEW_CACHE_DIR="$DOKKU_ROOT/$NEW_APP/cache"
apps_create "$NEW_APP" apps_create "$NEW_APP"
cd "$DOKKU_ROOT/$OLD_APP/." pushd "$DOKKU_ROOT/$OLD_APP/."
find * -not \( -name .cache \) | cpio -pvdmu "$DOKKU_ROOT/$NEW_APP" find ./* -not \( -name .cache \) | cpio -pvdmu "$DOKKU_ROOT/$NEW_APP"
cd - popd
if [[ -d "$NEW_CACHE_DIR" ]] && ! rmdir "$NEW_CACHE_DIR"; then if [[ -d "$NEW_CACHE_DIR" ]] && ! rmdir "$NEW_CACHE_DIR"; then
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$NEW_CACHE_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$NEW_CACHE_DIR:/cache" "dokku/$OLD_APP" chmod 777 -R /cache