forked from klederson/yaml.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild
More file actions
executable file
·58 lines (45 loc) · 1.17 KB
/
Copy pathbuild
File metadata and controls
executable file
·58 lines (45 loc) · 1.17 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
#!/bin/sh
cd `dirname $0`
# Generate yaml.js
file="bin/yaml.js"
> $file
echo Compiling $file ...
echo " - LICENSE"
echo "/*" >> $file
cat LICENSE >> $file
echo "\n*/" >> $file
echo "(function(){" >> $file
echo " - YamlParseException.js"
cat src/yaml/YamlParseException.js >> $file
echo " - Yaml.js"
cat src/yaml/Yaml.js >> $file
echo " - YamlInline.js"
cat src/yaml/YamlInline.js >> $file
echo " - YamlParser.js"
cat src/yaml/YamlParser.js >> $file
echo " - YamlEscaper.js"
cat src/yaml/YamlEscaper.js >> $file
echo " - YamlUnescaper.js"
cat src/yaml/YamlUnescaper.js >> $file
echo " - YamlDumper.js"
cat src/yaml/YamlDumper.js >> $file
echo "})();" >> $file
# Generate yaml.min.js
file="bin/yaml.min.js"
echo "compressing..."
echo "/*" > $file
cat LICENSE >> $file
echo "\n*/" >> $file
uglifyjs -nc bin/yaml.js >> $file
echo "yaml.js compiled."
echo "yaml.min.js compiled."
# Generate yaml2json
echo "#!/usr/bin/env node" > bin/yaml2json
cat src/cli/yaml2json.js >> bin/yaml2json
chmod +x bin/yaml2json
echo "yaml2json compiled."
# Generate json2yaml
echo "#!/usr/bin/env node" > bin/json2yaml
cat src/cli/json2yaml.js >> bin/json2yaml
chmod +x bin/json2yaml
echo "json2yaml compiled."