never-say-you-cant-survive/generate.sh

26 lines
551 B
Bash
Raw Normal View History

2020-10-09 10:14:15 +00:00
#!/bin/bash
mkdir -p chapters html
INPUT_FILE="urls.txt"
function assert_installed() {
for var in "$@"; do
if ! which $var &> /dev/null; then
echo "Install $var!"
exit 1
fi
done
}
assert_installed wget pandoc
while IFS= read -r line
do
echo $line
FILENAME=$(basename "$line")
wget --no-clobber --no-verbose --output-document="html/$FILENAME.html" --timeout=10 "$line"
done < "$INPUT_FILE"
2020-10-19 08:48:01 +00:00
bundle exec ruby generate.rb
if [ -f /.dockerenv ]; then
cp never-say-you-cant-survive.epub /output
fi