mirror of
				https://github.com/the-sane/lug-helper.git
				synced 2025-11-04 08:23:20 +00:00 
			
		
		
		
	Additional sanity checks
This commit is contained in:
		@@ -244,11 +244,20 @@ sanitize() {
 | 
				
			|||||||
    # Get/Set directory paths
 | 
					    # Get/Set directory paths
 | 
				
			||||||
    getdirs
 | 
					    getdirs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Sanity check
 | 
				
			||||||
 | 
					    if [ ! -d "$user_dir" ]; then
 | 
				
			||||||
 | 
						message 2 "Directory not found. The script will now exit.\n$user_dir"
 | 
				
			||||||
 | 
						exit 0
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Check for exported keybind files
 | 
					    # Check for exported keybind files
 | 
				
			||||||
    exported=0  # Default to none found
 | 
					 | 
				
			||||||
    if [ ! -d "$mappings_dir" ] || [ -z "$(ls -A "$mappings_dir")" ]; then
 | 
					    if [ ! -d "$mappings_dir" ] || [ -z "$(ls -A "$mappings_dir")" ]; then
 | 
				
			||||||
	message 1 "Warning: No exported keybindings found.  Keybinds will not be backed up!"
 | 
						if message 3 "Warning: No exported keybindings found. Keybinds will not be backed up!\n\nDo you want to continue anyway?"; then
 | 
				
			||||||
	    exported=0
 | 
						    exported=0
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
						    message 2 "The script will now exit."
 | 
				
			||||||
 | 
						    exit 0
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
	exported=1
 | 
						exported=1
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user