Created
December 20, 2020 11:23
-
-
Save armanozak/8fe6c6d0bac9322fe776db8b44010e73 to your computer and use it in GitHub Desktop.
[How to Initiate a Demo App Quickly in Your Terminal] Add a Quick Demo Function to Zsh #zsh #tips
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
# rest of your Zsh configuration here | |
demo () { | |
if [ ! "$#" -gt 0 ]; then echo "Missing application name!"; return 1; fi | |
case "$2" in | |
"") | |
mkdir $1; | |
cd $1; | |
npm init -y; | |
;; | |
angular) | |
npx @angular/cli new $1 --minimal --routing --strict --style=css | |
cd $1; | |
;; | |
react) | |
npx create-react-app my-app $1; | |
cd $1; | |
;; | |
vue) | |
npx create vite-app $1; | |
cd $1; | |
npm install; | |
;; | |
*) | |
echo "Unknown application type!"; | |
;; | |
esac | |
} |
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
# rest of your Zsh configuration here | |
demo () { | |
if [ ! "$#" -gt 0 ]; then echo "Missing application name!"; return 1; fi | |
case "$2" in | |
"") | |
mkdir $1; | |
cd $1; | |
npm init -y; | |
;; | |
angular) | |
npx @angular/cli new $1 --minimal --package-manager=yarn --routing --strict --style=css | |
cd $1; | |
;; | |
react) | |
yarn create react-app $1; | |
cd $1; | |
;; | |
vue) | |
yarn create vite-app $1; | |
cd $1; | |
yarn; | |
;; | |
*) | |
echo "Unknown application type!"; | |
;; | |
esac | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment