Merge pull request #6 from jonseymour/master
Quote file names to better tolerate filenames with whitespace.
This commit is contained in:
commit
0d617ca827
2 changed files with 5 additions and 5 deletions
|
@ -40,8 +40,8 @@ if [ $# -ne 1 ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
asc_key=${1}
|
asc_key=${1}
|
||||||
if [ ! -f ${asc_key} ]; then
|
if [ ! -f "${asc_key}" ]; then
|
||||||
echo "key file not found: ${asc_key}"
|
echo "key file not found: '${asc_key}'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -37,13 +37,13 @@ fi
|
||||||
chunks=()
|
chunks=()
|
||||||
index=1
|
index=1
|
||||||
for img in "$@"; do
|
for img in "$@"; do
|
||||||
if [ ! -f ${img} ]; then
|
if [ ! -f "${img}" ]; then
|
||||||
echo "image file not found: ${img}"
|
echo "image file not found: '${img}'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
asc_key="${tmp_file}.${index}"
|
asc_key="${tmp_file}.${index}"
|
||||||
echo "decoding ${img}"
|
echo "decoding ${img}"
|
||||||
chunk=$( zbarimg --raw --set disable --set qrcode.enable ${img} 2>/dev/null )
|
chunk=$( zbarimg --raw --set disable --set qrcode.enable "${img}" 2>/dev/null )
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "failed to decode QR image"
|
echo "failed to decode QR image"
|
||||||
exit 2
|
exit 2
|
||||||
|
|
Loading…
Reference in a new issue