@@ -32,15 +32,17 @@ _move-build-to-app() {
3232}
3333
3434_select-buildpack () {
35- local checked_out_path=" $build_path "
36- # checkout app code if build_path is a bare git repo
37- if [ -f " $build_path /HEAD" ] && [ -d " $build_path /objects" ]; then
38- # If bare repo is detected, check out worktree, as expected by buildpacks
39- tmpdir=$( mktemp -d)
40- git --git-dir=" $build_path " --work-tree=" $tmpdir " checkout -f & > /dev/null
41- chown -R " $unprivileged_user :$unprivileged_group " " $tmpdir "
42- checked_out_path=" $tmpdir "
43- fi
35+ local checked_out_path=" $build_path "
36+ # checkout app code if build_path is a bare git repo
37+ if [ -f " $build_path /HEAD" ] && [ -d " $build_path /objects" ]; then
38+ # If bare repo is detected, check out worktree, as expected by buildpacks
39+ tmpdir=$( mktemp -d)
40+ git --git-dir=" $build_path " --work-tree=" $tmpdir " checkout -f & > /dev/null
41+ # unprivileged_user & unprivileged_group defined in outer scope
42+ # shellcheck disable=SC2154
43+ chown -R " $unprivileged_user :$unprivileged_group " " $tmpdir "
44+ checked_out_path=" $tmpdir "
45+ fi
4446 if [[ -n " $BUILDPACK_URL " ]]; then
4547 title " Fetching custom buildpack"
4648 # buildpack_path defined in outer scope
@@ -79,10 +81,10 @@ _select-buildpack() {
7981 buildpack_id=" ${buildpack_id#* _buildpack-} "
8082
8183 # Output proper JSON
82- jq -n \
83- --arg name " $selected_name " \
84- --arg id " $buildpack_id " \
85- ' {name: $name, id: $id}'
84+ jq -n \
85+ --arg name " $selected_name " \
86+ --arg id " $buildpack_id " \
87+ ' {name: $name, id: $id}'
8688 else
8789 title " $selected_name app detected"
8890 fi
@@ -97,11 +99,11 @@ _select-buildpack() {
9799}
98100
99101buildpack-detect () {
100- declare desc=" Detect suitable buildpack for an application"
101- ensure-paths
102- [[ " $USER " ]] || randomize-unprivileged
103- buildpack-setup > /dev/null
104- _select-buildpack
102+ declare desc=" Detect suitable buildpack for an application"
103+ ensure-paths
104+ [[ " $USER " ]] || randomize-unprivileged
105+ buildpack-setup > /dev/null
106+ _select-buildpack
105107}
106108
107109buildpack-build () {
0 commit comments