-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathscripts.sh
executable file
·60 lines (41 loc) · 1.69 KB
/
scripts.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
#!/bin/bash
set -e
# Base directory for this entire project
BASEDIR=$(cd $(dirname $0) && pwd)
# Read the entered command
command=${1:-empty}
if [ $command == install ]
then
# -----------------------------------------------------------------
# (1) install, link with semantic-ui less styles
# -----------------------------------------------------------------
printf '%s\n' "Create semantic-ui theme config file @ node_modules/semantic-ui-less/theme.config"
echo '/* Reference the websemantics/strong-together app config file */
@import "resources/assets/less/semantic/theme.config";
/* End Config */' > "$BASEDIR/node_modules/semantic-ui-less/theme.config"
printf '%s\n' "All done, .."
elif [ $command == deploy ]
then
# ---------------------------------------------------------------------------
# (2) Deploy, the following bash will deploy this app to the repo gh-page
# ---------------------------------------------------------------------------
npm install
npm run build
# Create a new Git repo in public folder
cd "$BASEDIR/public"
git init
# Set user details
git config user.name "iAyeBot"
git config user.email "iayebot@websemantics.ca"
# First commit, .. horray!
git add .
git commit -m "Deploy to gh-pages"
# Force push ...
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
printf '%s\n' "All done, .."
else
# -----------------------------------------------------------------
# (3) Nothing, show something .. anything ..
# -----------------------------------------------------------------
printf '%s\n%s\n' "Please type a valid command option:" "(1) install or (2) deploy"
fi