-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreplaceToc.sh
More file actions
executable file
·43 lines (39 loc) · 1.2 KB
/
replaceToc.sh
File metadata and controls
executable file
·43 lines (39 loc) · 1.2 KB
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
#!/usr/bin/env bash
if [ -z "${midnight}" ]; then
midnight="120001,120005"
fi
if [ -z "${retail}" ]; then
retail="120001,120005"
fi
if [ -z "${mists}" ]; then
mists=50503
fi
if [ -z "${cata}" ]; then
cata=40402
fi
if [ -z "${wrath}" ]; then
wrath=30403
fi
if [ -z "${bcc}" ]; then
bcc=20505
fi
if [ -z "${classic}" ]; then
classic=11508
fi
if [ $# -eq 0 ]; then
find . \( ! -regex '.*/\..*' \) -type f -name "*.toc" -exec sed -i \
"s/@toc-version-midnight@/$midnight/g; s/@toc-version-retail@/$retail/g; s/@toc-version-mists@/$mists/g; s/@toc-version-cata@/$cata/g; s/@toc-version-wrath@/$wrath/g; s/@toc-version-bc@/$bcc/g; s/@toc-version-bcc@/$bcc/g; s/@toc-version-vanilla@/$classic/g; s/@toc-version-classic@/$classic/g" \
{} +
fi
for var in "$@"
do
sed -i "s/@toc-version-midnight@/$midnight/g" "$var"
sed -i "s/@toc-version-retail@/$retail/g" "$var"
sed -i "s/@toc-version-mists@/$mists/g" "$var"
sed -i "s/@toc-version-cata@/$cata/g" "$var"
sed -i "s/@toc-version-wrath@/$wrath/g" "$var"
sed -i "s/@toc-version-bc@/$bcc/g" "$var"
sed -i "s/@toc-version-bcc@/$bcc/g" "$var"
sed -i "s/@toc-version-classic@/$classic/g" "$var"
sed -i "s/@toc-version-vanilla@/$classic/g" "$var"
done