Remove unwanted output when binary is unavailable
This commit is contained in:
parent
8a637eb45a
commit
7a42fac34d
@ -111,9 +111,9 @@ The requirement is to have =pdftk= or =stapler= installed.
|
||||
#+begin_src bash
|
||||
if [[ -f $1 && $1 == *.pdf ]]; then
|
||||
# Argument if a file
|
||||
if type stapler > /dev/null; then
|
||||
if type stapler > /dev/null 2>&1; then
|
||||
stapler del "$1" 1 /tmp/pdftk_out.pdf && mv /tmp/pdftk_out.pdf "$1"
|
||||
elif type pdftk > /dev/null; then
|
||||
elif type pdftk > /dev/null 2>&1; then
|
||||
pdftk "$1" cat 2-end output /tmp/pdftk_out.pdf && mv /tmp/pdftk_out.pdf "$1"
|
||||
else
|
||||
echo "Neither pdftk nor stapler are installed"
|
||||
|
Loading…
Reference in New Issue
Block a user