summaryrefslogtreecommitdiffstats
path: root/lib/python/qmk/submodules.py
diff options
context:
space:
mode:
authorZach White <skullydazed@gmail.com>2021-05-19 15:49:11 -0700
committerZach White <skullydazed@gmail.com>2021-05-19 15:49:11 -0700
commit6955c5a00295382d3b4151a840aa5c929cd98059 (patch)
tree26109c4ed2a266650fc5fad19ce5f784bc7c346b /lib/python/qmk/submodules.py
parent82aa9ad4a567695d1f7d0b1e36bf8563d2967813 (diff)
parentdb1eacdaacb9c8f6889f46bc1c6af155b81ad72a (diff)
Merge remote-tracking branch 'origin/master' into develop
Resolved Conflicts: lib/python/qmk/tests/test_cli_commands.py util/install/fedora.sh
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)