#!/bin/bash if [ -z "$NPM_PACKAGE_TO_INSTALL" ]; then echo "Warning: NPM_PACKAGE_TO_INSTALL is not defined !" echo "Switching back to the default S2I behavior" exec "$STI_SCRIPTS_PATH/assemble" 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 ./