mirror of
https://github.com/dokku/dokku.git
synced 2026-05-18 05:05:46 +02:00
The builder-dockerfile, builder-lambda, builder-nixpacks, builder-pack and builder-railpack `core-post-extract` triggers assigned `$2` to a local `SOURCECODE_WORK_DIR` but called `pushd "$TMP_WORK_DIR"`, which was unset. Bash 5.2 silently accepted `pushd ""`, so the bug stayed dormant. Bash 5.3 (shipped with Ubuntu 26.04) makes it a hard error and `set -e` aborts the trigger, causing every `git push` to fail with `pushd: null directory`.
31 lines
842 B
Bash
Executable File
31 lines
842 B
Bash
Executable File
#!/usr/bin/env bash
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|
source "$PLUGIN_AVAILABLE_PATH/builder-nixpacks/internal-functions"
|
|
set -eo pipefail
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
|
|
trigger-builder-nixpacks-core-post-extract() {
|
|
declare desc="builder-nixpacks post-extract plugin trigger"
|
|
declare trigger="post-extract"
|
|
declare APP="$1" SOURCECODE_WORK_DIR="$2"
|
|
local NEW_NIXPACKS_YML="$(fn-builder-nixpacks-computed-nixpackstoml-path "$APP")"
|
|
|
|
pushd "$SOURCECODE_WORK_DIR" >/dev/null
|
|
|
|
if [[ -z "$NEW_NIXPACKS_YML" ]]; then
|
|
return
|
|
fi
|
|
|
|
if [[ ! -f "$NEW_NIXPACKS_YML" ]]; then
|
|
rm -f nixpacks.toml
|
|
return
|
|
fi
|
|
|
|
if [[ "$NEW_NIXPACKS_YML" != "nixpacks.toml" ]]; then
|
|
mv "$NEW_NIXPACKS_YML" nixpacks.toml
|
|
fi
|
|
popd &>/dev/null || pushd "/tmp" >/dev/null
|
|
}
|
|
|
|
trigger-builder-nixpacks-core-post-extract "$@"
|