summaryrefslogtreecommitdiff
path: root/lib/python/qmk/submodules.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk/submodules.py')
-rw-r--r--lib/python/qmk/submodules.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/python/qmk/submodules.py b/lib/python/qmk/submodules.py
index be51a68043..6a272dae50 100644
--- a/lib/python/qmk/submodules.py
+++ b/lib/python/qmk/submodules.py
@@ -1,7 +1,6 @@
"""Functions for working with QMK's submodules.
"""
-
-import subprocess
+from milc import cli
def status():
@@ -18,7 +17,7 @@ def status():
status is None when the submodule doesn't exist, False when it's out of date, and True when it's current
"""
submodules = {}
- git_cmd = subprocess.run(['git', 'submodule', 'status'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=30, universal_newlines=True)
+ git_cmd = cli.run(['git', 'submodule', 'status'], timeout=30)
for line in git_cmd.stdout.split('\n'):
if not line:
@@ -53,19 +52,19 @@ def update(submodules=None):
# Update everything
git_sync_cmd.append('--recursive')
git_update_cmd.append('--recursive')
- subprocess.run(git_sync_cmd, check=True)
- subprocess.run(git_update_cmd, check=True)
+ cli.run(git_sync_cmd, check=True)
+ cli.run(git_update_cmd, check=True)
else:
if isinstance(submodules, str):
# Update only a single submodule
git_sync_cmd.append(submodules)
git_update_cmd.append(submodules)
- subprocess.run(git_sync_cmd, check=True)
- subprocess.run(git_update_cmd, check=True)
+ cli.run(git_sync_cmd, check=True)
+ cli.run(git_update_cmd, check=True)
else:
# Update submodules in a list
for submodule in submodules:
- subprocess.run(git_sync_cmd + [submodule], check=True)
- subprocess.run(git_update_cmd + [submodule], check=True)
+ cli.run([*git_sync_cmd, submodule], check=True)
+ cli.run([*git_update_cmd, submodule], check=True)