-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask-runner.sh.command
executable file
·73 lines (67 loc) · 2.13 KB
/
task-runner.sh.command
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
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
##################################
# Snappy Food #
# Update files for FTP to server #
##################################
banner="Snappy Food"
projectHome=$(cd $(dirname $0); pwd)
pkgInstallHome=$(dirname $(dirname $(which httpd)))
apacheCfg=$pkgInstallHome/etc/httpd
apacheLog=$pkgInstallHome/var/log/httpd/error_log
webDocRoot=$(grep ^DocumentRoot $apacheCfg/httpd.conf | awk -F'"' '{ print $2 }')
setupTools() {
cd $projectHome
echo
echo $banner
echo $(echo $banner | sed s/./=/g)
pwd
test -d .git || { echo "Project must be in a git repository."; exit; }
git restore dist/* &>/dev/null
git pull --ff-only
echo
echo "Node.js:"
which node || { echo "Need to install Node.js: https://nodejs.org"; exit; }
node --version
npm install --no-fund
npm update --no-fund
npm outdated
echo
}
copyGraphics() {
cd $projectHome/websites
echo "Graphics:"
cp -v ../graphics/bookmark.png www.snappyfood.org/graphics
cp -v ../graphics/rice-bowl.png www.snappyfood.org/graphics
cp -v ../graphics/rice-bowl-card.png www.snappyfood.org/graphics
cp -v ../graphics/rice-bowl-mobile.png www.snappyfood.org/graphics/mobile-home-screen.png
cp -v ../graphics/bookmark.png www.dragonsgrill.org/graphics
cp -v ../graphics/dragons-grill.png www.dragonsgrill.org/graphics
cp -v ../graphics/dragons-grill-card.png www.dragonsgrill.org/graphics
cp -v ../graphics/dragons-grill-mobile.png www.dragonsgrill.org/graphics/mobile-home-screen.png
echo
}
publishWebFiles() {
cd $projectHome
publishSite=$webDocRoot/centerkey.com
publish() {
echo "Publishing:"
echo $publishSite
cp -R websites/www.* $publishSite
ls -o $publishSite | grep snappyfood
ls -o $publishSite | grep dragonsgrill
open http://localhost/centerkey.com/www.snappyfood.org
open http://localhost/centerkey.com/www.dragonsgrill.org
echo
}
test -w $publishSite && publish
}
runSpecs() {
cd $projectHome
echo "Specifications:"
npm test
echo
}
setupTools
copyGraphics
publishWebFiles
runSpecs