-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure
executable file
·78 lines (58 loc) · 1.72 KB
/
configure
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
#!/bin/bash
BIN_FILE="./bin/pas"
CMD_DIR="./gen"
CMD_FILE="$CMD_DIR/pas.js"
mkdir -p "$CMD_DIR"
cat > "$CMD_FILE" <<EOL
// libdir
global.APP_LIB_DIR = '$PWD/lib';
// includes
// global.APP_INCLUDES = {
// providers: [],
// profiles: []
// };
var PolyfillPromise = require('promise');
if (global.Promise) {
for(var i in PolyfillPromise) {
if (!global.Promise[i]) {
global.Promise[i] = PolyfillPromise[i];
}
}
} else {
global.Promise = PolyfillPromise;
}
EOL
# echo "// include providers" >> "$CMD_FILE"
# ls lib/providers | while read a; do
# echo "APP_INCLUDES.providers.push('../lib/providers/${a%.*}');" >> "$CMD_FILE"
# done
# echo "// include profiles" >> "$CMD_FILE"
# ls lib/profiles | while read a; do
# echo "APP_INCLUDES.profiles.push('../lib/profiles/${a%.*}');" >> "$CMD_FILE"
# done
cat >> "$CMD_FILE" <<EOL
var dummyToForceIncludeForBundle = false;
if (dummyToForceIncludeForBundle) {
EOL
# echo " // tasks" >> "$CMD_FILE"
# ls lib/tasks | while read a; do
# echo " require('../lib/tasks/${a%.*}');" >> "$CMD_FILE"
# done
echo " // providers" >> "$CMD_FILE"
ls lib/providers 2> /dev/null | while read a; do
echo " require('../lib/providers/${a%.*}');" >> "$CMD_FILE"
done
echo " // profiles" >> "$CMD_FILE"
ls lib/profiles 2> /dev/null | while read a; do
echo " require('../lib/profiles/${a%.*}');" >> "$CMD_FILE"
done
echo "}" >> "$CMD_FILE"
############################
echo "// bin" >> "$CMD_FILE"
tail -n 1 "$BIN_FILE" >> "$CMD_FILE"
echo >> "$CMD_FILE"
############################
# echo " // tasks" >> "$CMD_FILE"
# ls lib/tasks | while read a; do
# echo " require('$PWD/lib/tasks/${a%.*}');" >> "$CMD_FILE"
# done