Ver a proveniência

adding check and abort process if the temp file already exists, prob has a 0.000000000000001% chance of happening, but that is not zero anyways

master
Gustavo Neves há 8 anos
ascendente
cometimento
69ce95d61e
1 ficheiros alterados com 5 adições e 0 eliminações
  1. +5
    -0
      pdfScale.sh

+ 5
- 0
pdfScale.sh Ver ficheiro

@@ -70,6 +70,7 @@ EXIT_MISSING_DEPENDENCY=25
EXIT_IMAGEMAGIK_NOT_FOUND=26
EXIT_MAC_MDLS_NOT_FOUND=27
EXIT_PDFINFO_NOT_FOUND=28
EXIT_TEMP_FILE_EXISTS=40
EXIT_INVALID_PAPER_SIZE=50


@@ -91,6 +92,10 @@ main() {
if isMixedMode; then
outputFile="$OUTFILEPDF" # backup outFile name
tempFile="${OUTFILEPDF%.pdf}.$tempSuffix" # set a temp file name
if isFile "$tempFile"; then
printError $'Error! Temporary file name already exists!\n'"File: $tempFile"$'\nAborting execution to avoid overwriting the file.\nPlease Try again...'
exit $EXIT_TEMP_FILE_EXISTS
fi
OUTFILEPDF="$tempFile" # set output to tmp file
pageResize # resize to tmp file
finalRet=$?


Carregando…
Cancelar
Guardar