You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
551 B
Bash
26 lines
551 B
Bash
#!/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"
|
|
|
|
bundle exec ruby generate.rb
|
|
|
|
if [ -f /.dockerenv ]; then
|
|
cp never-say-you-cant-survive.epub /output
|
|
fi |