#!/bin/bash if [ -z "$NPM_PACKAGE_TO_INSTALL" ]; then echo "Error: NPM_PACKAGE_TO_INSTALL is not defined" exit 1 fi # Exit on any error set -e echo "---> Installing application from NPM ..." npm install "$NPM_PACKAGE_TO_INSTALL" # Trim package name (remove the version number) package_name="${NPM_PACKAGE_TO_INSTALL%@*}" echo "---> Linking application ..." ln -s "node_modules/$package_name" main fix-permissions ./