-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_portfolio.sh
executable file
·63 lines (50 loc) · 1.6 KB
/
create_portfolio.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/zsh
echo "Hi there! What's your full name?"
read NAME
echo "And what year are you in, $NAME?"
read YEAR
echo "Please describe yourself in one sentence!"
echo "(ex: A first year student exploring web development)"
read TAGLINE
echo "Tell me a bit more about yourself.."
read ABOUTME
MEMBER="null"
while [[ "$MEMBER" != "yes" && "$MEMBER" != "no" ]]
do
echo "Do you want to get involved as an official UofTWeb member? (yes/no)"
read MEMBER
done
if [ "$MEMBER" != 'no' ]; then
echo "What's your UofT Email Address?"
read EMAIL
echo "What's your student number?"
read NUMBER
echo "And finally, what college are you registered in?"
read COLLEGE
echo "$NAME,$EMAIL,$NUMBER,$COLLEGE" >>membership.csv
echo "Thank you for becoming a member! Now to just finish up the site.."
fi
echo Building your site...
DIR="../autosite/$NAME-$YEAR"
mkdir $DIR
cp template.html "$DIR/index.html"
cp template.css "$DIR/style.css"
cp template.js "$DIR/main.js"
cp template.md "$DIR/README.md"
cp fork.png "$DIR/fork.png"
cp -r static "$DIR/static"
# replacing stuff
sed -i '' "s/VAR_NAME/$NAME/g" "$DIR/index.html"
sed -i '' "s/VAR_SUMMARY/$SUMMARY/g" "$DIR/index.html"
sed -i '' "s/VAR_LINK/https:\/\/uoftweb\.github\.io\/$NAME\//g" "$DIR/README.md"
sed -i '' "s/VAR_NAME/$NAME/g" "$DIR/README.md"
# create git project
echo Initializing git
cd $DIR
git init -b main
git stage *
git commit -m "🥳 initial commit"
# create gh project
gh repo create "uoftweb/$NAME" --source=. --public --push
echo Done creating project, turn on pages to go public!
open "https://github.com/uoftweb/$NAME/settings/pages"