From 74c904501e36b3bad66bea747a5bdc2c5f3e8aba Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:43:19 +0100 Subject: [PATCH] Small style and quoting tweaks --- bin/build | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/build b/bin/build index 69cda93..0da0db4 100755 --- a/bin/build +++ b/bin/build @@ -122,7 +122,7 @@ cache_dir="${layers_dir}/shim" mkdir -p "${cache_dir}" echo "cache = true" >"${layers_dir}/shim.toml" -"${target_dir}/bin/compile" "$app_dir" "${cache_dir}" "${platform_dir}/env" +"${target_dir}/bin/compile" "${app_dir}" "${cache_dir}" "${platform_dir}/env" # copy profile.d scripts into a layer so they will be sourced if [[ -d .profile.d ]]; then @@ -130,19 +130,19 @@ if [[ -d .profile.d ]]; then mkdir -p "${profile_dir}/profile.d" for script in .profile.d/*; do - dest="${profile_dir}/profile.d/$(basename "$script")" + dest="${profile_dir}/profile.d/$(basename "${script}")" # wrap each script and set $HOME to - cat <<'EOF' >"$dest" -__cnb_shim__HOME=$HOME + cat <<'EOF' >"${dest}" +__cnb_shim__original_HOME="${HOME}" HOME=$(pwd) EOF - cat "$script" >>"$dest" - cat <<'EOF' >>"$dest" + cat "${script}" >>"${dest}" + cat <<'EOF' >>"${dest}" -HOME=$__cnb_shim__HOME -unset __cnb_shim__HOME +HOME="${__cnb_shim__original_HOME}" +unset __cnb_shim__original_HOME EOF done @@ -156,4 +156,4 @@ if [[ -f "${target_dir}/export" ]]; then fi # run bin/release, read Procfile, and generate launch.toml -"${bp_dir}/bin/release" "${target_dir}" "${layers_dir}" "${platform_dir}" "$app_dir" +"${bp_dir}/bin/release" "${target_dir}" "${layers_dir}" "${platform_dir}" "${app_dir}"