forked from Khan/perseus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
operations.sh
executable file
·44 lines (39 loc) · 1.09 KB
/
operations.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
#!/bin/sh
if [ "X$1" = "X-w" ]
then
webapp=$1
else
webapp=../webapp
fi
if ! test -d "$webapp"
then
echo "Could not find webapp at $webapp" >&2
echo "Use -w [location] to set webapp location" >&2
exit 1
fi
case $1 in
-h | --help | help)
echo "Use -w as an initial option to change the webapp path"
echo "Command: get-css, put-js, put-css"
exit 0
;;
get-css)
pwd=$(pwd)
cd "$webapp"
make css
cd "$pwd"
manifest="$webapp/genfiles/stylesheets-packages-compressed.json"
shared=$(node stylesheets/get_css_name.js "$manifest")
cp "$webapp/stylesheets/shared-package/$shared" stylesheets/shared.css
;;
put-js)
cp build/perseus.min.js "$webapp/javascript/perseus-package"
;;
put-css)
pap="stylesheets/perseus-admin-package"
files=$(find $pap -maxdepth 1 -type f)
cp $files "$webapp/$pap"
files=$(find stylesheets/exercise-content-package -maxdepth 1 -type f)
cp $files "$webapp/stylesheets/exercise-content-package"
;;
esac