-
Notifications
You must be signed in to change notification settings - Fork 92
/
macGenFormDef.sh
executable file
·40 lines (39 loc) · 1.29 KB
/
macGenFormDef.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
#!/bin/bash
TEMP="/formDef.json"
if [ "$1" ]; then
for f in "$@"
do
TEMP2="${f%/*.xlsx}"
if [ -f $TEMP2$TEMP ]; then
rm $TEMP2$TEMP
fi
#base64 $f | /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc macGenConverter.js >> $TEMP2$TEMP
node macGenConverter.js $f >> $TEMP2$TEMP
done
else
for f in app/config/tables/*/forms/*/*.xlsx
do
x=$f
P=${x%.xlsx}
FILENAME="${P##*/}"
P="${f%/*.xlsx}"
FOLDERNAME="${P##*/}"
TEMP2="${f%/*.xlsx}"
if [ "$FILENAME" == "$FOLDERNAME" ]; then
if [ -f $TEMP2$TEMP ]; then
rm $TEMP2$TEMP
fi
#base64 $f | /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc macGenConverter.js >> $TEMP2$TEMP
node macGenConverter.js $f >> $TEMP2$TEMP
fi
done
for f in app/config/assets/framework/forms/framework/framework.xlsx
do
TEMP2="${f%/*.xlsx}"
if [ -f $TEMP2$TEMP ]; then
rm $TEMP2$TEMP
fi
#base64 $f | /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc macGenConverter.js >> $TEMP2$TEMP
node macGenConverter.js $f >> $TEMP2$TEMP
done
fi