1
1
#! /usr/bin/env bash
2
-
3
- # foundation-website-init.sh from within http://github.com/wilsonmar/git-utilities
2
+ # foundation-website-init.sh from http://github.com/wilsonmar/git-utilities
4
3
# by Wilson Mar ([email protected] , @wilsonmar)
5
4
6
5
TZ=" :UTC" date +%z
@@ -15,30 +14,69 @@ git --version
15
14
16
15
GITHUB_USER=" hotwilson"
17
16
REPONAME=' website1'
18
- echo ${REPONAME} > website_name
19
17
20
- npm install -g foundation-cli
18
+ echo " ******** GITHUB_USER= $GITHUB_USER "
21
19
22
- npm i -g npm
20
+ mkdir ~ /gits/${GITHUB_USER}
21
+ cd ~ /gits/${GITHUB_USER}
22
+
23
+ echo " ******** STEP Delete \" $REPONAME \" remnant from previous run:"
24
+ # set -x # xtrace command echo on (with ++ prefix). http://www.faqs.org/docs/abs/HTML/options.html
25
+ # Remove folder if exists (no symbolic links are used here):
26
+ if [ -d ${REPONAME} ]; then
27
+ rm -rf ${REPONAME}
28
+ fi
29
+
30
+ CURRENTDIR=${PWD##*/ }
31
+ echo " CURRENTDIR=$CURRENTDIR "
23
32
33
+ # exit #3
34
+
35
+
36
+ # These can be run from any directory:
37
+ # install node
38
+ npm install -g foundation-cli
39
+ npm i -g npm
24
40
# Verify if foundation has been installed or abort:
25
41
foundation -version
26
42
27
- mkdir ~ /gits/${GITHUB_USER} /${REPONAME}
28
- cd ~ /gits/${GITHUB_USER} /${REPONAME}
43
+ # exit #4
44
+
45
+ echo ${REPONAME} > website_name
46
+ foundation new --framework sites --template zurb < website_name
47
+ # WARNING: A large amount of output comes out.
29
48
30
- git clone https://github.com/${GITHUB_USER} /${REPONAME}
49
+ cd ${REPONAME}
50
+ pwd
31
51
52
+ # exit #5
53
+
54
+ # Download dependencies per package.json:
32
55
npm install
33
56
34
- git init && git add . && git commit -m”Initial”
57
+ # exit #6
35
58
36
- # Run in batch :
59
+ # Start web server :
37
60
npm start &
38
61
62
+ # exit #7
63
+
64
+ # Add template:
65
+
66
+ # exit #8
67
+
39
68
npm run build
69
+ # exit #9
40
70
41
71
open http://localhost:8000
42
72
43
- git add . && git commit -m”update” && git push
73
+ exit # 10
74
+
75
+
76
+
77
+ # git add . && git commit -m”update” && git push
78
+
79
+ # git init && git add . && git commit -m”Initial”
80
+
81
+ # exit #10
44
82
0 commit comments