-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
66 lines (63 loc) · 2.23 KB
/
Taskfile.yml
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
version: 3
tasks:
deconstruct:
desc: group to single file
cmds:
- rm state.txt || true
- cat state/group0.txt >> state.txt
- cat state/group1.txt >> state.txt
- cat state/group2.txt >> state.txt
- cat state/group3.txt >> state.txt
- cat state/group4.txt >> state.txt
- cat state/group5.txt >> state.txt
- cat state/group6.txt >> state.txt
- cat state/group7.txt >> state.txt
- python3 remove_prefix.py
construct:
desc: single file to group files
cmds:
- python3 split.py
- rm state/group0.txt
- mv state_0.txt state/group0.txt
- rm state/group1.txt
- mv state_1.txt state/group1.txt
- rm state/group2.txt
- mv state_2.txt state/group2.txt
- rm state/group3.txt
- mv state_3.txt state/group3.txt
- rm state/group4.txt
- mv state_4.txt state/group4.txt
- rm state/group5.txt
- mv state_5.txt state/group5.txt
- rm state/group6.txt
- mv state_6.txt state/group6.txt
- rm state/group7.txt
- mv state_7.txt state/group7.txt
rename:
desc: rename SRC to TRG
cmds:
- test -f "state/{{.SRC}}.mid" && echo "{{.SRC}} exists."
- cmd: echo {{default "failed" .TRG }} | grep -v failed || (echo ERROR - TRG variable not set && exit 255)
silent: true
- mv "state/{{.SRC}}.mid" "state/{{.TRG}}.mid"
- cmd: echo "rename in state"
silent: true
- cmd: sed -i'.bak' -e 's/{{.SRC}}.mid/{{.TRG}}.mid/g' state.txt
silent: true
- cmd: sed -i'.bak' -e 's/{{.SRC}}.mid/{{.TRG}}.mid/g' state/group0.txt
silent: true
- cmd: sed -i'.bak' -e 's/{{.SRC}}.mid/{{.TRG}}.mid/g' state/group1.txt
silent: true
- cmd: sed -i'.bak' -e 's/{{.SRC}}.mid/{{.TRG}}.mid/g' state/group2.txt
silent: true
- cmd: sed -i'.bak' -e 's/{{.SRC}}.mid/{{.TRG}}.mid/g' state/group3.txt
silent: true
- cmd: sed -i'.bak' -e 's/{{.SRC}}.mid/{{.TRG}}.mid/g' state/group4.txt
silent: true
- cmd: sed -i'.bak' -e 's/{{.SRC}}.mid/{{.TRG}}.mid/g' state/group5.txt
silent: true
- cmd: sed -i'.bak' -e 's/{{.SRC}}.mid/{{.TRG}}.mid/g' state/group6.txt
silent: true
- cmd: sed -i'.bak' -e 's/{{.SRC}}.mid/{{.TRG}}.mid/g' state/group7.txt
silent: true
- rm state/*.bak