mirror of
https://github.com/captn3m0/never-say-you-cant-survive.git
synced 2024-09-07 22:46:34 +00:00
26 lines
551 B
Bash
Executable File
26 lines
551 B
Bash
Executable File
#!/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 |