From 6528c4511ac8abecf74174e9205a9637c4f7df37 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 13 Dec 2017 00:44:11 -0500 Subject: [PATCH] fix: handle case in ubuntu 16.04 where popd may fail if the dokku user does not have rights to execute in the executing user's $PWD. Closes #2978 --- plugins/apps/subcommands/clone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/apps/subcommands/clone b/plugins/apps/subcommands/clone index d19637c74..1223aeb32 100755 --- a/plugins/apps/subcommands/clone +++ b/plugins/apps/subcommands/clone @@ -23,7 +23,7 @@ apps_clone_cmd() { apps_create "$NEW_APP" pushd "$DOKKU_ROOT/$OLD_APP/." > /dev/null find ./* -not \( -name .cache \) | grep -v "./cache" | cpio -pdmu --quiet "$DOKKU_ROOT/$NEW_APP" - popd > /dev/null + popd > /dev/null 2>&1 || pushd "/tmp" > /dev/null 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