fix: incorrect type comparaison lead to infinite loop when not in ck project
This commit is contained in:
		
							parent
							
								
									d912e7d4ce
								
							
						
					
					
						commit
						b9fa1422a4
					
				
					 2 changed files with 3 additions and 1 deletions
				
			
		|  | @ -5,6 +5,7 @@ import logging | ||||||
| from cutekit import const, project, vt100, plugins, cmds | from cutekit import const, project, vt100, plugins, cmds | ||||||
| from cutekit.args import parse | from cutekit.args import parse | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| def setupLogger(verbose: bool): | def setupLogger(verbose: bool): | ||||||
|     if verbose: |     if verbose: | ||||||
|         logging.basicConfig( |         logging.basicConfig( | ||||||
|  | @ -31,6 +32,7 @@ def setupLogger(verbose: bool): | ||||||
|             datefmt="%Y-%m-%d %H:%M:%S", |             datefmt="%Y-%m-%d %H:%M:%S", | ||||||
|         ) |         ) | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| def main() -> int: | def main() -> int: | ||||||
|     try: |     try: | ||||||
|         a = parse(sys.argv[1:]) |         a = parse(sys.argv[1:]) | ||||||
|  |  | ||||||
|  | @ -5,7 +5,7 @@ from pathlib import Path | ||||||
| 
 | 
 | ||||||
| def root() -> str | None: | def root() -> str | None: | ||||||
|     cwd = Path.cwd() |     cwd = Path.cwd() | ||||||
|     while cwd != Path.root: |     while str(cwd) != cwd.root: | ||||||
|         if (cwd / "project.json").is_file(): |         if (cwd / "project.json").is_file(): | ||||||
|             return str(cwd) |             return str(cwd) | ||||||
|         cwd = cwd.parent |         cwd = cwd.parent | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue