mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
packages/easyscan: sanity checks
This commit is contained in:
parent
d1f27a4724
commit
2e8db32bfb
1 changed files with 6 additions and 0 deletions
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
OUTPUT_FILE="${1:-./scan_"$(date)".pdf}"
|
||||
|
||||
if [ -e "$OUTPUT_FILE" ]; then
|
||||
echo "$OUTPUT_FILE" already exists, you are probably making a mistake!
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tempdir="$(mktemp -d)"
|
||||
counter=1
|
||||
|
||||
|
|
@ -36,6 +41,7 @@ merged_filename="$tempdir/easyscan_final.pdf"
|
|||
pdfunite "$tempdir"/*.pdf "$merged_filename"
|
||||
|
||||
# Copy scan to current directory
|
||||
mkdir -p "$(dirname "$OUTPUT_FILE")"
|
||||
cp "$merged_filename" "$OUTPUT_FILE"
|
||||
|
||||
# Make sure I don't remove things other than pdf
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue