Skip to content

Instantly share code, notes, and snippets.

@anxiousmodernman
Last active December 3, 2015 03:37
Show Gist options
  • Save anxiousmodernman/1b903f12fa74030b3343 to your computer and use it in GitHub Desktop.
Save anxiousmodernman/1b903f12fa74030b3343 to your computer and use it in GitHub Desktop.
Is this a good idea
npm_install()
{
cd $PROJECT_HOME # package.json in here
if npm install
then
return 0
else
return 1
fi
}
do_build()
{
if ! type npm > /dev/null
then
echo "npm command not found. Please install npm and/or configure your shell."
exit 1
fi
if npm_install # call my function
then
# foo
echo "npm install was cool"
else
# fail
echo "npm install is mega fail"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment