Emit errors if files are missing

This commit is contained in:
Jérémy Lecour 2020-05-05 11:30:37 +02:00 committed by Jérémy Lecour
parent 3161e93856
commit 229aab510a

View file

@ -251,7 +251,7 @@ create() {
# csr-file option, with value separated by space # csr-file option, with value separated by space
if [ -n "$2" ]; then if [ -n "$2" ]; then
from_csr=1 from_csr=1
csr_file=$(readlink -f -- "${2}") csr_file=$(readlink --canonicalize --verbose -- "${2}")
shift shift
else else
printf 'ERROR: "--csr-file" requires a non-empty option argument.\n' >&2 printf 'ERROR: "--csr-file" requires a non-empty option argument.\n' >&2
@ -261,7 +261,7 @@ create() {
--file=?*|--csr-file=?*) --file=?*|--csr-file=?*)
from_csr=1 from_csr=1
# csr-file option, with value separated by = # csr-file option, with value separated by =
csr_file=$(readlink -f -- "${1#*=}") csr_file=$(readlink --canonicalize --verbose -- "${1#*=}")
;; ;;
--file=|--csr-file=) --file=|--csr-file=)
# csr-file options, without value # csr-file options, without value
@ -274,7 +274,7 @@ create() {
--password-file) --password-file)
# password-file option, with value separated by space # password-file option, with value separated by space
if [ -n "$2" ]; then if [ -n "$2" ]; then
password_file=$(readlink -f -- "${2}") password_file=$(readlink --canonicalize --verbose -- "${2}")
shift shift
else else
printf 'ERROR: "--password-file" requires a non-empty option argument.\n' >&2 printf 'ERROR: "--password-file" requires a non-empty option argument.\n' >&2
@ -283,7 +283,7 @@ create() {
;; ;;
--password-file=?*) --password-file=?*)
# password-file option, with value separated by = # password-file option, with value separated by =
password_file=$(readlink -f -- "${1#*=}") password_file=$(readlink --canonicalize --verbose -- "${1#*=}")
;; ;;
--password-file=) --password-file=)
# password-file options, without value # password-file options, without value