forked from Spreadsheets/WickedGrid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild
More file actions
80 lines (62 loc) · 1.48 KB
/
Copy pathbuild
File metadata and controls
80 lines (62 loc) · 1.48 KB
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
74
75
76
77
78
79
80
#!/bin/bash
#compile parsers
#cd parser/formula
#node ../../../jison/ports/php/php.js formula.jison
#cd ../../
# directories of the JS files
JS_IN_DIR='./Sheet'
JS_OUT_DIR='.'
#these are the paths to the final combined files that you want to have in the end
JS_TEMP=""
JS_WRAPPER=$(<"$JS_IN_DIR/wrapper.js")
JS_COMBINED_FILE="$JS_OUT_DIR/jquery.sheet.js"
JS_COMBINED_FILE_MIN="$JS_OUT_DIR/jquery.sheet.min.js"
JS_FILES=(
#namespace first
Base.js
#non-constructors next
fn.js
sheet.js
thread.js
utilities.js
#children namespaces next
Loader/HTML.js
Loader/JSON.js
Loader/XML.js
#constructors next
ActionUI.js
Cell.js
CellHandler.js
CellTypeHandlers.js
CellRange.js
Highlighter.js
SpreadsheetUI.js
Theme.js
#environment correction last
environmentCorrection.js
)
PARSER_FILES=(
parser/formula/formula.js
parser/tsv/tsv.js
)
#clear the files
> $JS_COMBINED_FILE
> $JS_COMBINED_FILE_MIN
# Add header
sed '/CODE_HERE/,$d' < Sheet/wrapper.js >> $JS_COMBINED_FILE
#run thru the JS files
for F in ${JS_FILES[@]}; do
cat $JS_IN_DIR/$F >> $JS_COMBINED_FILE
done
# Add footer
sed '1,/CODE_HERE/d' < Sheet/wrapper.js >> $JS_COMBINED_FILE
#echo "${JS_WRAPPER//CODE_HERE/$JS_TEMP}" > $JS_COMBINED_FILE
#run thru the parser files
for F in ${PARSER_FILES[@]}; do
cat $F >> $JS_COMBINED_FILE
done
#compress it
yui-compressor -o $JS_COMBINED_FILE_MIN $JS_COMBINED_FILE
#add the file to the git base
#git add $JS_COMBINED_FILE
#git add $JS_COMBINED_FILE_MIN