checks for nonexistent dirs
This commit is contained in:
		
							parent
							
								
									9a13c3c393
								
							
						
					
					
						commit
						405fd3cad5
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -121,9 +121,13 @@ class KollagenBot:
 | 
			
		|||
            return False
 | 
			
		||||
 | 
			
		||||
        directories = [
 | 
			
		||||
            os.path.join(self.base_dir or "./", dir) for dir in args.directories
 | 
			
		||||
            (dir, os.path.join(self.base_dir or "./", dir)) for dir in args.directories
 | 
			
		||||
        ]
 | 
			
		||||
 | 
			
		||||
        for orig_dir, full_path in directories:
 | 
			
		||||
            if not os.path.exists(full_path):
 | 
			
		||||
                raise FileNotFoundError(f'"{orig_dir}" does not exist.')
 | 
			
		||||
 | 
			
		||||
        mode = ["-m", args.mode] if args.mode else []
 | 
			
		||||
        num_images = ["-n", str(args.num_images)] if args.num_images else []
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -131,7 +135,7 @@ class KollagenBot:
 | 
			
		|||
            shell_cmd_line = [
 | 
			
		||||
                self.kollagen_path,
 | 
			
		||||
                "-r",
 | 
			
		||||
                *directories,
 | 
			
		||||
                *[full_path for _, full_path in directories],
 | 
			
		||||
                "-w",
 | 
			
		||||
                str(args.width),
 | 
			
		||||
                "-h",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue