-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
debug.sh
32 lines (28 loc) · 791 Bytes
/
debug.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
# helper script for debuging/developing new recipes
if [ -z "$1" ];
then
echo "No recipe specified."
echo "Usage: sh debug.sh example"
exit 9
fi
get_abs_dirname() {
# $1 : relative filename
echo "$(cd "$(dirname "$1")" && pwd)/"
}
# use to get shared code
export recipes_includes=$(get_abs_dirname "recipes/includes/recipes_shared.py")
for recipe_folder in 'recipes' 'recipes_custom'
do
if [ -f "$recipe_folder/$1.recipe.py" ]; then
cp -p "$recipe_folder/$1.recipe.py" "$1.recipe"
fi
if [ -f "$recipe_folder/$1.recipe" ]; then
cp -p "$recipe_folder/$1.recipe" "$1.recipe"
fi
done
rm -rf debug
ebook-convert "$1.recipe" .epub --test --debug-pipeline debug -vv && \
open debug/input/index.html
if [ -f "$1.recipe" ]; then
rm -f "$1.recipe"
fi