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
This commit is contained in:
Jose Diaz-Gonzalez
2017-12-13 00:44:11 -05:00
parent fe6f339890
commit 6528c4511a

View File

@@ -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