Skip to content

Instantly share code, notes, and snippets.

@mstruebing
Created March 18, 2019 07:44
Show Gist options
  • Save mstruebing/272efcad005cad1afaa025d805061d62 to your computer and use it in GitHub Desktop.
Save mstruebing/272efcad005cad1afaa025d805061d62 to your computer and use it in GitHub Desktop.
abstraction around package mananger
function package_manager() {
local type="$1"
local command="$2"
local args="$3"
local POSSIBLE_INSTALL_COMMAND=(install add require)
case $type in
'npm' )
if [[ " ${POSSIBLE_INSTALL_COMMAND[*]} " == *" $command "* ]]; then
npm install "$args"
fi
'yarn' )
echo "$type";;
'composer' )
echo "$type";;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment