From 8bee5aa974e9a5fc142368ee775917532144d35f Mon Sep 17 00:00:00 2001 From: "uni@bor.mac" Date: Mon, 9 Jun 2025 23:14:34 +0200 Subject: [PATCH] README.md: add info about install script --- README.md | 26 +++++++++++++++++++++++++- install.sh | 7 ++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5201216..95bb4fd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ CLI script to rearrange pdf pages for printing book signatures and foldable zines -## INSTALL pdf2book in Linux or macOS +## Install pdf2book in Linux or macOS ### Dependencies: - [`bash`](https://www.gnu.org/software/bash/) (mostly already installed) @@ -12,6 +12,30 @@ CLI script to rearrange pdf pages for printing book signatures and foldable zine - [`venv`](https://docs.python.org/3/library/venv.html) (might be installed) - check with `python3 -m venv --help` +### Installation script +use the installation script +```bash +# create temporary directory +TMPDIR=$(mktemp -d) +# change into temporary dir +pushd $TMPDIR +# clone pdf2book source code +git clone https://git.wlankabel.at/onipa/pdf2book.git +# change into pdf2book directory +pushd pdf2book +# show help message of install script +bash install.sh -h +# execute interactive install script +bash install.sh +# change to previous folder +popd +popd +# remove temporary folder +rm -rf $TMPDIR +``` + +### install manually + ```bash #!/bin/bash PREFIX="$HOME/.local" diff --git a/install.sh b/install.sh index 6e53b7c..2604259 100755 --- a/install.sh +++ b/install.sh @@ -17,7 +17,7 @@ HELP=""" $0: install pdf2book with its virtual environment usage: -h|--help show this help message and exti - -d|--delete remove pdf2book + -d|--delete remove pdf2book installation -f|--force force overwriting of PREFIX/lib/pdf2book.git can be used for upgrading -p|--prefix PREFIX install into PREFIX/lib and PREFIX/bin @@ -30,6 +30,11 @@ while [[ $# -gt 0 ]]; do case "$1" in --delete|-d) DELETE=1 + echo 'THIS DOES NOTHING AT THE MOMENT ...' + echo 'todo:' + echo " - [ ] remove $PREFIX/pdf2book.git" + echo " - [ ] and clean your ~/.bashrc or ~/.zshrc" + exit 0 ;; --force|-f) FORCE=1