Skip to content

Commit

Permalink
Small style and quoting tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
edmorley committed Apr 19, 2024
1 parent b0d3636 commit 74c9045
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -122,27 +122,27 @@ 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
profile_dir="${layers_dir}/profile"

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 <app dir>
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

Expand All @@ -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}"

0 comments on commit 74c9045

Please sign in to comment.