-
Notifications
You must be signed in to change notification settings - Fork 118
/
OTL.sh
executable file
·68 lines (43 loc) · 1.27 KB
/
OTL.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
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
#!/bin/bash
#
# Quick-and-dirty utility script for extract Houdini .otl files to ascii and vice versa.
#
#
# TODO: check if parameter 1 exists
echo "otl.sh: \"$1\""
pushd .
case "$1" in
clean_built|cb|clean)
echo "*** CLEAN: DELETING BUILT OTLS ***"
find . -name "*.otl" -exec rm -rf {} \;
;;
#;& # (fallthru)
build|b)
echo "*** BUILDING OTLS ***"
find . -name "*_OTL" | awk '{ d=$0; sub(/_OTL$/, ".otl", d); print "hotl -C " $0 " " d }' | bash
find . -name "*.bkp*" -exec rm {} \; # delete backups created by otl building
;;
buildmime|bm)
echo "*** BUILDING OTLS (MIME) ***"
find . -name "*_OTL" | awk '{ d=$0; sub(/_OTL$/, ".otl", d); print "hotl -l " $0 " " d }' | bash
find . -name "*.bkp*" -exec rm {} \; # delete backups created by otl building
;;
clean_extracted|cx)
echo "*** DELETING EXTRACTED OTLS ***"
find . -name "*_OTL" -exec rm -rf {} \;
;;
#;& # (fallthru)
extract|x)
echo "*** EXTRACTING OTLS ***"
find . -name "*.otl" | awk '{ d=$0; sub(/\.otl$/, "_OTL", d); print "hotl -X " d " " $0 }' | bash
;;
extractmime|xm)
echo "*** EXTRACTING OTLS (MIME) ***"
find . -name "*.otl" | awk '{ d=$0; sub(/\.otl$/, "_OTL", d); print "hotl -p -t " d " " $0 }' | bash
;;
*)
echo "unknown command: \"$1\""
;;
esac
popd
echo "done."