Created
March 18, 2019 07:44
-
-
Save mstruebing/272efcad005cad1afaa025d805061d62 to your computer and use it in GitHub Desktop.
abstraction around package mananger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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