fix: do not attempt to move the Dockerfile if it is the default path

Also drop the unnecessary rm call
This commit is contained in:
Jose Diaz-Gonzalez
2021-10-06 02:03:39 -04:00
committed by GitHub
parent fd28bf53de
commit 51c5c58354

View File

@@ -16,15 +16,16 @@ trigger-builder-dockerfile-core-post-extract() {
return
fi
if [[ ! -f "$NEW_DOCKERFILE" ]]; then
dokku_log_fail "Invalid dockerfile-path specified: $NEW_DOCKERFILE"
rm -f Dockerfile
if [[ "$NEW_DOCKERFILE" == "Dockerfile" ]]; then
return
fi
if [[ "$NEW_DOCKERFILE" != "Dockerfile" ]]; then
mv "$NEW_DOCKERFILE" Dockerfile
if [[ ! -f "$NEW_DOCKERFILE" ]]; then
dokku_log_fail "Invalid dockerfile-path specified: $NEW_DOCKERFILE"
return
fi
mv "$NEW_DOCKERFILE" Dockerfile
popd &>/dev/null
}