mirror of
https://github.com/qmk/qmk_cli.git
synced 2026-08-03 07:46:45 -04:00
improve the qmk setup flow (#20)
* improve the qmk setup flow * Apply suggestions from code review Co-Authored-By: Erovia <Erovia@users.noreply.github.com> * Update qmk_cli/subcommands/setup.py * explicity set encoding to utf-8 * polishing Co-authored-by: Erovia <Erovia@users.noreply.github.com>
This commit is contained in:
+5
-5
@@ -9,7 +9,7 @@ default_fork = 'qmk/' + default_repo
|
||||
default_branch = 'master'
|
||||
|
||||
|
||||
def clone(url, destination, branch):
|
||||
def git_clone(url, destination, branch):
|
||||
git_clone = [
|
||||
'git',
|
||||
'clone',
|
||||
@@ -20,13 +20,13 @@ def clone(url, destination, branch):
|
||||
]
|
||||
cli.log.debug('Git clone command: %s', git_clone)
|
||||
|
||||
with subprocess.Popen(git_clone, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, bufsize=1, universal_newlines=True) as p:
|
||||
with subprocess.Popen(git_clone, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, bufsize=1, universal_newlines=True, encoding='utf-8') as p:
|
||||
for line in p.stdout:
|
||||
print(line, end='')
|
||||
|
||||
if p.returncode != 0:
|
||||
cli.log.error('git clone exited %d', p.returncode)
|
||||
return False
|
||||
else:
|
||||
cli.log.info('Successfully cloned %s to %s!', cli.args.fork, cli.args.destination)
|
||||
return True
|
||||
cli.log.info('Successfully cloned %s to %s!', url, destination)
|
||||
|
||||
return p.returncode
|
||||
|
||||
Reference in New Issue
Block a user