vérifier l'existence du fichier input

This commit is contained in:
Jephté Clain 2014-01-22 17:31:18 +04:00
parent f0644feebd
commit f4a9922c7f
2 changed files with 8 additions and 0 deletions

View File

@ -100,6 +100,10 @@ if [ "$1" != "--" ]; then
query="$1"; shift
fi
if [ -n "$input" -a "$input" != "-" ]; then
[ -f "$input" ] || die "$input: fichier introuvable"
fi
if [ -n "${configs[*]}" ]; then
PROFILE="$profile"
array_fix_paths configs

View File

@ -112,6 +112,10 @@ if [ -n "${configs[*]}" ]; then
fi
[ -n "$table" ] || die "Vous devez spécifier la table dans laquelle se fera l'importation"
if [ -n "$input" -a "$input" != "-" ]; then
[ -f "$input" ] || die "$input: fichier introuvable"
fi
isnum "$skip_lines" || skip_lines=0
if [ -n "${fields[*]}" ]; then