Skip to content

Instantly share code, notes, and snippets.

@armanozak
Created December 20, 2020 11:23
Show Gist options
  • Save armanozak/8fe6c6d0bac9322fe776db8b44010e73 to your computer and use it in GitHub Desktop.
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
# 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
}
# 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