Commit d93ee4ce authored by Jonathan Clem's avatar Jonathan Clem Committed by zeke

Add scripts.start to Procfile from package.json

If no Procfile exists and there is a scripts.start in package.json, add
the scripts.start script as the 'web' process type to a new Procfile.
parent 484299c2
...@@ -80,6 +80,17 @@ status "Cleaning up node-gyp and npm artifacts" ...@@ -80,6 +80,17 @@ status "Cleaning up node-gyp and npm artifacts"
rm -rf "$build_dir/.node-gyp" rm -rf "$build_dir/.node-gyp"
rm -rf "$build_dir/.npm" rm -rf "$build_dir/.npm"
# Add npm start to Procfile if necessary
if [ ! -e $build_dir/Procfile ]; then
npm_start=$(cat $build_dir/package.json | $bp_dir/vendor/jq -r .scripts.start)
# If a start script is declared, add it to a Procfile
if [ "$npm_start" != "null" ]; then
status "No Procfile present; adding npm start script to Procfile"
echo "web: $npm_start" > $build_dir/Procfile
fi
fi
# Update the PATH # Update the PATH
status "Building runtime environment" status "Building runtime environment"
mkdir -p $build_dir/.profile.d mkdir -p $build_dir/.profile.d
......
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