git.iko.soy/heroku-buildpack-stack
on master help sign in
Switch to a perl expression from sed. Substitute all of the variables in one go.
commitf41b89358f534767d89b2ba3b342841034889b81 authorMark Fine <mark.fine@gmail.com> dateWed 22 Jun 2016, 14:25 (10 years ago) parent6d1a8c4
1 file changed+1−3
bin/compile+1−3
bin/compile+1−3
@@ -79,9 +79,7 @@ chmod a+x "$WORK_DIR/vendor/bin/stack"
7979########## stack vars ##############################################
8080if [ -d "$ENV_DIR" ]; then
8181 speak "Substituting stack vars"
82− for e in $(ls "$ENV_DIR"); do
83− sed -i "s/{{$e}}/$(cat $ENV_DIR/$e)/g" "$BUILD_DIR/stack.yaml"
84− done
82+ perl -p -i -e 's/\{\{([^}]+)\}\}/defined$ENV{$1}?$ENV{$1}:$&/eg'
8583fi
8684
8785########## project build ###########################################