Skip to content

Commit e881a2c

Browse files
committed
chore(common): cd into build_dir at runtime
1 parent 2db1113 commit e881a2c

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test-buildpack: clean-test-buildpack
2222
$(BUILDPACK_DIR)/bin/compile $(BUILD_DIR) $(CACHE_DIR) $(ENV_DIR)
2323
# Confirm staged dependencies are importable before checking the release metadata.
2424
cd $(BUILD_DIR) && /bin/bash -lc 'source .profile.d/python.sh && $(PYTHON_BIN) -c "import fastapi; print(fastapi.__version__)"'
25-
cd $(BUILD_DIR) && $(BUILDPACK_DIR)/bin/release
25+
$(BUILDPACK_DIR)/bin/release $(BUILD_DIR)
2626

2727
# Start the staged sample app locally using the dependencies prepared by `test-buildpack`.
2828
start-local:

bin/release

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
set -euo pipefail
55

6+
BUILD_DIR="${1:?BUILD_DIR argument is required}"
7+
cd "$BUILD_DIR"
8+
69
# Prefer the Python interpreter staged by `bin/compile`, but fall back to a
710
# system interpreter so local development and unit tests can still run.
811
if [ -x ".python/bin/python3" ]; then

test/unit/release_test.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ run_release() {
7777

7878
set +e
7979
(
80-
cd "$app_dir"
81-
PATH="$FAKE_BIN_DIR:/usr/bin:/bin" REAL_PYTHON3="$REAL_PYTHON3" "$RELEASE_SCRIPT"
80+
PATH="$FAKE_BIN_DIR:/usr/bin:/bin" REAL_PYTHON3="$REAL_PYTHON3" "$RELEASE_SCRIPT" "$app_dir"
8281
) >"$output_file" 2>&1
8382
status=$?
8483
set -e

0 commit comments

Comments
 (0)