Commit 4f34e6bf authored by Joe Kutner's avatar Joe Kutner Committed by Jeremy Morrell

Only write export script if dir is writable (#539)

parent 25310973
......@@ -73,6 +73,12 @@ write_ci_profile() {
write_export() {
local bp_dir="$1"
local build_dir="$2"
echo "export PATH=\"$build_dir/.heroku/node/bin:$build_dir/.heroku/yarn/bin:\$PATH:$build_dir/node_modules/.bin\"" > $bp_dir/export
echo "export NODE_HOME=\"$build_dir/.heroku/node\"" >> $bp_dir/export
# only write the export script if the buildpack directory is writable.
# this may occur in situations outside of Heroku, such as running the
# buildpacks locally.
if [ -w ${bp_dir} ]; then
echo "export PATH=\"$build_dir/.heroku/node/bin:$build_dir/.heroku/yarn/bin:\$PATH:$build_dir/node_modules/.bin\"" > $bp_dir/export
echo "export NODE_HOME=\"$build_dir/.heroku/node\"" >> $bp_dir/export
fi
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment