mirror of
				https://github.com/kevinveenbirkenbach/directory-content-scanner.git
				synced 2025-11-03 19:38:08 +00:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			632334f574
			...
			36c5b62812
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 36c5b62812 | |||
| ba2a345305 | 
							
								
								
									
										9
									
								
								scan.py
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								scan.py
									
									
									
									
									
								
							@@ -79,14 +79,14 @@ class DirectoryHandler:
 | 
			
		||||
            if no_comments:
 | 
			
		||||
                file_type = os.path.splitext(file_path)[1]
 | 
			
		||||
                content = CodeProcessor.remove_comments(content, file_type)
 | 
			
		||||
            print(f"======== File Path: {file_path} ========")
 | 
			
		||||
            print(f"<< START: {file_path} >>")
 | 
			
		||||
            if compress:
 | 
			
		||||
                compressed_content = CodeProcessor.compress(content)
 | 
			
		||||
                print(f"======== Compressed Code ========")
 | 
			
		||||
                print(f"COMPRESSED CODE: ")
 | 
			
		||||
                print(compressed_content)
 | 
			
		||||
            else:
 | 
			
		||||
                print(content)
 | 
			
		||||
            print("==================================\n")
 | 
			
		||||
            print("<< END >>\n")
 | 
			
		||||
        except UnicodeDecodeError:
 | 
			
		||||
            print(f"Warning: Could not read file due to encoding issues: {file_path}")
 | 
			
		||||
            exit(1)
 | 
			
		||||
@@ -124,7 +124,8 @@ def main():
 | 
			
		||||
        if os.path.isdir(path):
 | 
			
		||||
            DirectoryHandler.handle_directory(path, file_filters=args.filetype, ignore_strings=args.ignore, ignore_hidden=args.ignore_hidden, verbose=args.verbose, no_comments=args.no_comments, compress=args.compress, strings=args.strings)
 | 
			
		||||
        elif os.path.isfile(path):
 | 
			
		||||
            DirectoryHandler.handle_file(path, file_filters=args.filetype, ignore_strings=args.ignore, ignore_hidden=args.ignore_hidden, no_comments=args.no_comments, compress=args.compress)
 | 
			
		||||
            if DirectoryHandler.should_print_file(path, file_filters=args.filetype, ignore_strings=args.ignore, ignore_hidden=args.ignore_hidden, include_strings=args.strings):
 | 
			
		||||
                DirectoryHandler.handle_file(path, file_filters=args.filetype, ignore_strings=args.ignore, ignore_hidden=args.ignore_hidden, no_comments=args.no_comments, compress=args.compress)
 | 
			
		||||
        else:
 | 
			
		||||
            print(f"Error: {path} is neither a valid file nor a directory.")
 | 
			
		||||
            exit(1)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user