preflight checks
This commit is contained in:
Vendored
+1
-17
@@ -1,19 +1,3 @@
|
||||
{
|
||||
"bookmarks": [
|
||||
{
|
||||
"fsPath": "$ROOTPATH$/borghelper.sh",
|
||||
"bookmarks": [
|
||||
-1,
|
||||
8,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1
|
||||
]
|
||||
}
|
||||
]
|
||||
"bookmarks": []
|
||||
}
|
||||
@@ -101,3 +101,29 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
done
|
||||
|
||||
|
||||
### check parameter validity
|
||||
|
||||
# no operation
|
||||
if [ -z "$operation" ]; then
|
||||
consoleError 1 'Nothing to do!'
|
||||
fi
|
||||
|
||||
# list without archive
|
||||
if [ "$operation" = 'list' ] && [ -z "$archiveName" ]; then
|
||||
consoleError 1 "List operation requested but no archive name provided. Please use '--list-all' for a list of all available archives."
|
||||
fi
|
||||
|
||||
# restore with no path
|
||||
if [ "$operation" = 'restore' ] && [ -z "$restorePath" ]; then
|
||||
consoleError 1 "Restore operation requested but no restore path provided."
|
||||
# restore with no archive
|
||||
elif [ "$operation" = 'restore' ] && [ -z "$archiveName" ]; then
|
||||
consoleError 1 "Restore operation requested but no archive name provided."
|
||||
fi
|
||||
|
||||
# file provided but no archive
|
||||
if [ "$fileName" ] && [ -z "$archiveName" ]; then
|
||||
consoleError 1 "Filename specified without an associated archive name."
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user