File tree Expand file tree Collapse file tree 1 file changed +37
-18
lines changed Expand file tree Collapse file tree 1 file changed +37
-18
lines changed Original file line number Diff line number Diff line change 1- #! /bin/sh
2-
3- IN=$1
4- INJS=${IN/ \. ts/ \. js}
5- OUT=$2
6- tsc -t es6 -m es6 $IN || exit 1
7-
8- echo package struct2ts > $OUT
9- echo >> $OUT
10- echo " const ts_helpers = \` " >> $OUT
11- cat $IN >> $OUT
12- echo " \` " >> $OUT
13-
14- echo >> $OUT
15- echo " const es6_helpers = \` " >> $OUT
16- perl -pe ' s/\s{4}/\t/g' < $INJS >> $OUT
17- rm $INJS
18- echo " \` " >> $OUT
1+ #! /bin/bash -e
2+
3+ IN=" $1 "
4+ OUT=" $2 "
5+
6+ if test " ${IN} x" = " x" ; then
7+ echo " Please provide input file (hint helper.ts)" ;
8+ exit 1
9+ fi
10+
11+ if test " ${OUT} x" = " x" ; then
12+ echo " Please provide output file (hint helpers_gen.go)" ;
13+ exit 1
14+ fi
15+
16+ if test ! -e " ${IN} " ; then
17+ echo " ${IN} doesn't exist" ;
18+ exit 1
19+ fi
20+
21+ INJS=" ${IN/ \. ts/ \. js} "
22+
23+ echo " Creating ${OUT} "
24+
25+ tsc -t es6 -m es6 " ${IN} " || exit 1
26+
27+ echo package struct2ts > " ${OUT} "
28+ echo >> " ${OUT} "
29+ echo " const ts_helpers = \` " >> " ${OUT} "
30+ cat " ${IN} " >> " ${OUT} "
31+ echo " \` " >> " ${OUT} "
32+
33+ echo >> " ${OUT} "
34+ echo " const es6_helpers = \` " >> " ${OUT} "
35+ perl -pe ' s/\s{4}/\t/g' < " $INJS " >> " ${OUT} "
36+ rm " ${INJS} "
37+ echo " \` " >> " ${OUT} "
You can’t perform that action at this time.
0 commit comments