Skip to content

Instantly share code, notes, and snippets.

@danywalls
Created February 5, 2023 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danywalls/193e46e42751e209760f29c1d3215b51 to your computer and use it in GitHub Desktop.
Save danywalls/193e46e42751e209760f29c1d3215b51 to your computer and use it in GitHub Desktop.
example of scaffolding with bash
#!/bin/bash
version="1.0"
#validate that the user passed the parameter
if [ -z "$1" ]
then
echo "Please add the parameter to script ex: ./scaffold.sh blog"
exit
fi
#get the project name parameter
projectName=$1
#set a list of directories to create
listOfDirectories="pages components store"
# use the angular cli to generate
npx -p @angular/cli ng new $projectName
cd $projectName
cd src
echo "Generate directories"
#create the list of directories
for directory in $listOfDirectories; do
mkdir $directory
done
# initialize git and commit the changes
git init
git add .
git commit -m "basic template"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment