Skip to content

Commit

Permalink
Fix bug in arg length to bin/release
Browse files Browse the repository at this point in the history
  • Loading branch information
jkutner committed Mar 5, 2019
1 parent eb736a4 commit 47b7947
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ set -eu
bp_dir=$(cd $(dirname $0)/..; pwd) # absolute path
target_dir="${bp_dir}/target"
layers_dir="${1:?}"
platform_dir="${2:?}"

# create a shim cache layer
cache_dir="${layers_dir}/shim"
mkdir -p "${cache_dir}"
echo "cache = true" > ${layers_dir}/shim.toml

"${target_dir}/bin/compile" "$(pwd)" "${cache_dir}" "${2:?}/env"
"${target_dir}/bin/compile" "$(pwd)" "${cache_dir}" "${platform_dir}/env"

# copy profile.d scripts into a layer so they will be sourced
home_dir="${layers_dir}/home"
Expand All @@ -23,4 +24,4 @@ cp .profile.d/* "${home_dir}/profile.d/"
echo "launch = true" > ${layers_dir}/home.toml

# run bin/release, read Procfile, and generate launch.toml
"${bp_dir}/bin/release" "${target_dir}" "${layers_dir}"
"${bp_dir}/bin/release" "${target_dir}" "${layers_dir}" "${platform_dir}"
4 changes: 2 additions & 2 deletions cmd/release/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
)

func main() {
if len(os.Args) != 3 {
fmt.Println("Usage:", os.Args[0], "TARGET_BUILDPACK_DIR", "LAYERS_DIR")
if len(os.Args) != 4 {
fmt.Println("Usage:", os.Args[0], "TARGET_BUILDPACK_DIR", "LAYERS_DIR", "PLATFORM_DIR")
return
}

Expand Down

0 comments on commit 47b7947

Please sign in to comment.