From 550d0aac16fce5bb1653b4185f1ca4ef2ad8dec1 Mon Sep 17 00:00:00 2001 From: Michael De Roover Date: Wed, 19 Apr 2023 22:32:49 +0200 Subject: [PATCH] Update error handlers --- convert-psp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) mode change 100644 => 100755 convert-psp diff --git a/convert-psp b/convert-psp old mode 100644 new mode 100755 index f68fbd9..148afb6 --- a/convert-psp +++ b/convert-psp @@ -5,11 +5,19 @@ f_convert-psp(){ } help(){ - printf "Usage: $0 \"directory\" \"URL\"\n" + printf "Usage: $0\n" + exit 1 +} + +nojson(){ + printf "This program needs a configuration file, named \"subscriptions.json\".\n" + printf "Please create this file first.\n" + printf "See the readme for instructions on how to create it.\n" exit 1 } [[ "$1" == "-h" || "$1" == "--help" ]] && help +[ ! -f subscriptions.json ] && nojson saveifs=$IFS IFS=$'\n'