From 98a68b68a400f7b3821db1d77375a592b34cc8d6 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Mon, 12 Feb 2024 10:02:44 +0000 Subject: [PATCH] Fix git-submodule running in wrong location (#23059) --- lib/python/qmk/cli/git/submodule.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/python/qmk/cli/git/submodule.py b/lib/python/qmk/cli/git/submodule.py index ef116ea124..1cbfd74e88 100644 --- a/lib/python/qmk/cli/git/submodule.py +++ b/lib/python/qmk/cli/git/submodule.py @@ -1,8 +1,8 @@ import shutil +from pathlib import Path from milc import cli -from qmk.path import normpath from qmk import submodules REMOVE_DIRS = [ @@ -40,12 +40,12 @@ def git_submodule(cli): remove_dirs = REMOVE_DIRS if cli.config.git_submodule.force: # Also trash everything that isnt marked as "safe" - for path in normpath('lib').iterdir(): + for path in Path('lib').iterdir(): if not any(ignore in path.as_posix() for ignore in IGNORE_DIRS): remove_dirs.append(path) - for folder in map(normpath, remove_dirs): - if normpath(folder).is_dir(): + for folder in map(Path, remove_dirs): + if folder.is_dir(): print(f"Removing '{folder}'") shutil.rmtree(folder)