fix: incorrect type comparaison lead to infinite loop when not in ck project

This commit is contained in:
Jordan ⌨️ 2023-11-11 11:43:42 +01:00 committed by VAN BOSSUYT Nicolas
parent d912e7d4ce
commit b9fa1422a4
2 changed files with 3 additions and 1 deletions

View file

@ -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:])

View file

@ -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