Created
January 15, 2015 16:30
-
-
Save tonycoco/3888145a68c0d01beabf to your computer and use it in GitHub Desktop.
Ember CLI Project Update Bash Function
This file contains 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 ember-cli-update { | |
if [ -z "$1" ]; then | |
echo "$(tput setaf 1)No Ember CLI version has been specified. Example: ember-cli-update 0.1.7$(tput sgr 0)" | |
return 1 | |
fi | |
echo "$(tput setaf 2)Uninstalling global Ember CLI...$(tput sgr 0)" | |
npm uninstall -g ember-cli | |
echo "$(tput setaf 2)Cleaning NPM and Bower cache...$(tput sgr 0)" | |
npm cache clean | |
bower cache clean | |
echo "$(tput setaf 2)Installing global Ember CLI v$1...$(tput sgr 0)" | |
npm install -g ember-cli@$1 | |
echo "$(tput setaf 2)Cleaning temporary project files...$(tput sgr 0)" | |
rm -rf node_modules bower_components dist tmp | |
echo "$(tput setaf 2)Updating project to Ember CLI v$1...$(tput sgr 0)" | |
ember install:npm ember-cli@$1 | |
ember install | |
ember init | |
echo "$(tput setaf 2)Ember CLI update is complete!$(tput sgr 0)" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment