Skip to content

Instantly share code, notes, and snippets.

@danywalls
Created February 5, 2023 12:52
Embed
What would you like to do?
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