-
Notifications
You must be signed in to change notification settings - Fork 297
/
csvall.sh
executable file
·38 lines (38 loc) · 1.58 KB
/
csvall.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
#!/bin/bash
sed -i \
-e 's/^id,/#id,/' \
latest/en/_templates.csv latest/de/_templates.csv \
&& sed -i \
-e 's#^errorok,#onoff2,UCH,240=off;15=on,,\nyesno2,UCH,240=no;15=yes,,\nerrorok,#' \
-e 's#^errorok,#yesno2,UCH,240=no;15=yes,,\nerrorok,#' \
latest/en/vaillant/_templates.csv latest/de/vaillant/_templates.csv \
&& find latest/ -mindepth 3 -type f -not -name "_templates.csv" -exec sed -i \
-e 's#\(HcName.*\),STR:11,#\1,hcname,#i' \
-e 's#\(phone.*\),STR:9,#\1,phone,#i' \
-e 's#,UCH,hour,#,hours,,#i' \
-e 's#,UCH,,hours\?,\?#,hours,,,#i' \
-e 's#,ULG,hour,#,hoursum,,#i' \
-e 's#,ULG,,hour,#,hoursum,,,#i' \
-e 's#,UIN,,Steps,#,UIN,,,#i' \
-e 's#,UIN,,Schritte,#,UIN,,,#ig' \
-e 's#,UIN,,sec,#,seconds2,,,#ig' \
-e 's#,UCH,,sec,#,seconds0,,,#ig' \
-e 's#,mcmode,,,"0=OFF, 1=ON, 2=AUTO, 3=MANUAL"#,hwcmode2,,,#' \
-e 's#,hwcmode2,,,"0=OFF, 1=ON, 2=AUTO, 3=MANUAL"#,hwcmode2,,,#' \
-e 's#,ULG,,,Maintance Alarm Date#,DTM,,,Maintance Alarm Date#' \
-e 's#,HEX:8,,,DCF Time / date#,btime;bdate,,,DCF Time / date#' \
-e 's#^r,,FaultlistDK\[0\],#r,,FaultlistDK,#' \
-e 's#,,night-time#,,NightTime#i' \
-e 's#,,Time&Date#,,TimeDate#i' \
-e 's#,UCH,240=off;15=on,#,onoff2,,#' \
-e 's#,UCH,,,"Off=0, On=1"#,onoff,,,#' \
-e 's#,UCH,240=no;15=yes,#,yesno2,,#' \
\{\} \; \
&& npm run csv2tsp \
&& npm run csv2tsp-combine \
&& mv outtsp.de/i18n.yaml outtsp/i18n.yaml \
&& ( (cd outtsp.de && find . -type f) | xargs -i bash -c 'test -f outtsp/{} || cp outtsp.de/{} outtsp/{}') \
&& cp normalized/*.tsp outtsp/ \
&& npm run maintsp \
&& npm run format \
&& npm run lint