refactor: reverse if statements

The shell version of IsImageHerokuishBased returns true if it is CNB for legacy reasons...
This commit is contained in:
Jose Diaz-Gonzalez
2021-02-11 06:48:38 -05:00
parent b826770687
commit 5614475521
2 changed files with 19 additions and 6 deletions

View File

@@ -477,10 +477,10 @@ copy_from_image() {
if verify_image "$IMAGE"; then
if ! is_abs_path "$SRC_FILE"; then
if is_image_herokuish_based "$IMAGE" "$APP"; then
WORKDIR="/app"
elif is_image_cnb_based "$IMAGE"; then
if is_image_cnb_based "$IMAGE"; then
WORKDIR="/workspace"
elif is_image_herokuish_based "$IMAGE" "$APP"; then
WORKDIR="/app"
else
WORKDIR="$("$DOCKER_BIN" image inspect --format '{{.Config.WorkingDir}}' "$IMAGE")"
fi