From 62b3546e6231605843b0e1babc36661f28ae779b Mon Sep 17 00:00:00 2001 From: vitrinekast Date: Wed, 27 Mar 2024 17:30:23 +0000 Subject: [PATCH] pass path as var --- create_book.sh | 5 +++-- script.py | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/create_book.sh b/create_book.sh index 3392670..ee18349 100644 --- a/create_book.sh +++ b/create_book.sh @@ -1,9 +1,10 @@ #!/bin/bash -echo "execute a bash script that will create a book called " $1 +echo "execute a bash script that will create a book called " $1 +echo "from a file called" $2 index=$(shuf -i 1-14 -n 1) echo $index -pandoc /home/xpub/www/html/tl-dr/book.html -o /home/xpub/www/html/tl-dr/logged_book.epub -c print.css --metadata title="$1" --metadata author="/var/shelf" --epub-cover-image=assets/cover$index.jpg --epub-embed-font="fonts/Cascadia/ttf/CascadiaCode-Light.ttf" --epub-embed-font="fonts/Ductus/DuctusRegular.otf" +pandoc $2 -o /home/xpub/www/html/tl-dr/logged_book.epub -c print.css --metadata title="$1" --metadata author="/var/shelf" --epub-cover-image=assets/cover$index.jpg --epub-embed-font="fonts/Cascadia/ttf/CascadiaCode-Light.ttf" --epub-embed-font="fonts/Ductus/DuctusRegular.otf" cp /home/xpub/www/html/tl-dr/logged_book.epub /home/xpub/www/html/tl-dr/log-books/"$1".epub ls log-books > /home/xpub/www/html/tl-dr/log-books/all.txt diff --git a/script.py b/script.py index 4b2881d..e2b6c6e 100644 --- a/script.py +++ b/script.py @@ -116,7 +116,6 @@ except subprocess.CalledProcessError as e: print("Got all commands data"); -print(get_kitchen_prints()) # loading the jinja template environment env = Environment(loader=FileSystemLoader("/home/xpub/www/html/tl-dr/templates")) @@ -155,8 +154,8 @@ print("Storing the files"); with open(book_path, "w") as f: print(output, file=f) if not time_ago_arg: - subprocess.run(['sh', '/home/xpub/www/html/tl-dr/create_book.sh', book_name]) + subprocess.run(['sh', '/home/xpub/www/html/tl-dr/create_book.sh', book_name, book_path]) else: - print("i did not create an epub since im an oldie") + subprocess.run(['sh', '/home/xpub/www/html/tl-dr/create_book.sh', book_name, book_path]) print("Finished"); \ No newline at end of file