preflight checks
This commit is contained in:
		
							parent
							
								
									3fc67f9fe3
								
							
						
					
					
						commit
						7838b0c6e0
					
				
							
								
								
									
										18
									
								
								.vscode/numbered-bookmarks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.vscode/numbered-bookmarks.json
									
									
									
									
										vendored
									
									
								
							@ -1,19 +1,3 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	"bookmarks": [
 | 
						"bookmarks": []
 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			"fsPath": "$ROOTPATH$/borghelper.sh",
 | 
					 | 
				
			||||||
			"bookmarks": [
 | 
					 | 
				
			||||||
				-1,
 | 
					 | 
				
			||||||
				8,
 | 
					 | 
				
			||||||
				-1,
 | 
					 | 
				
			||||||
				-1,
 | 
					 | 
				
			||||||
				-1,
 | 
					 | 
				
			||||||
				-1,
 | 
					 | 
				
			||||||
				-1,
 | 
					 | 
				
			||||||
				-1,
 | 
					 | 
				
			||||||
				-1,
 | 
					 | 
				
			||||||
				-1
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	]
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -101,3 +101,29 @@ while [ $# -gt 0 ]; do
 | 
				
			|||||||
    shift
 | 
					    shift
 | 
				
			||||||
done
 | 
					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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user