refactoring

This commit is contained in:
Simon Vieille 2021-04-27 12:08:17 +02:00
parent a4a4744241
commit 4f5c85dbcc
1 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ error() {
exit 1
}
exit_if_empty() {
exitIfEmpty() {
if [ -z "$1" ]; then
error "$2"
fi
@ -97,8 +97,8 @@ if [ $ERROR -eq 1 ]; then
error "Invalid parameter\\n$(usage)"
fi
exit_if_empty "$INPUT_FILE" "Input file is missing (-i)"
exit_if_empty "$OUTPUT_FILE" "Output file is missing (-i)"
exitIfEmpty "$INPUT_FILE" "Input file is missing (-i)"
exitIfEmpty "$OUTPUT_FILE" "Output file is missing (-i)"
if [ ! -f "$INPUT_FILE" ]; then
error "No such file: $INPUT_FILE"