-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcomics
More file actions
57 lines (49 loc) · 1.21 KB
/
comics
File metadata and controls
57 lines (49 loc) · 1.21 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
44
45
46
47
48
49
50
51
52
53
54
55
56
makeCBRdirs ()
{
for f in *[cC][bB][rRzZ];
do
extension=$(echo "$f" | sed 's/.*\.\(...\)$/\1/');
dir=$(basename "$f" ".${extension}");
mkdir "$dir";
mv "$f" "$dir";
done
}
makeCBR()
{
pwd=$(pwd);
for d in *;
do
cd "$pwd/$d";
~jnn/bin/cbr2html.sh;
done
}
do_cbrs()
{
makeCBRdirs
makeCBR
}
makeCBRfixpound()
{
for f in *.jpg ; do
n=$(echo "$f" | sed 's/#//g')
mv "$f" "$n"
done
sed -i'.rmbak' 's/#//g' *.html
rm *.rmbak
}
help_comics()
{
cat <<EOF
Functions availble for dealing with CBR/CBZ files, unpacking them and generating HTML:
makeCBRdirs ()
- create all the directories for each CBR file in the current directory
makeCBR()
- iterate through all directories in current directory, and process the CBR in each directory, unpacking and generating HTML
do_cbrs()
- wrapper around the two above mentioned functions
makeCBRfixpound()
- web browsers get confused if any of the image names have a '#' sign in them - this will go through the current directory, rename all the jpgs, and correct the HTML
~/bin/make_comics.sh
- a less fragile version of do_cbrs, also automatically runs makeCBRfixpound
EOF
}