Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| be0dd95e46 | |||
| 30031a8cd7 |
+1
-1
@@ -1,3 +1,3 @@
|
||||
"""A program to help you work with qmk_firmware."""
|
||||
|
||||
__version__ = '0.0.13'
|
||||
__version__ = '0.0.14'
|
||||
|
||||
@@ -4,19 +4,22 @@ import os
|
||||
from pathlib import Path
|
||||
|
||||
from milc import cli
|
||||
from qmk_cli.git import clone
|
||||
from qmk_cli.git import clone as git_clone
|
||||
|
||||
default_repo = 'qmk_firmware'
|
||||
default_fork = 'qmk/' + default_repo
|
||||
default_branch = 'master'
|
||||
|
||||
|
||||
@cli.argument('--baseurl', default='https://github.com', help='The URL all git operations start from.')
|
||||
@cli.argument('-b', '--branch', default=default_branch, help='The branch to clone.')
|
||||
@cli.argument('destination', default=os.environ['QMK_HOME'], nargs='?', help='The directory to clone to.')
|
||||
@cli.argument('fork', default=default_fork, nargs='?', help='The qmk_firmware fork to clone')
|
||||
@cli.argument('--baseurl', default='https://github.com', help='The URL all git operations start from (Default: https://github.com)')
|
||||
@cli.argument('-b', '--branch', default=default_branch, help='The branch to clone (Default: %s)' % default_branch)
|
||||
@cli.argument('destination', default=None, nargs='?', help='The directory to clone to (Default: Current Directory)')
|
||||
@cli.argument('fork', default=default_fork, nargs='?', help='The qmk_firmware fork to clone (Default: %s)' % default_fork)
|
||||
@cli.subcommand('Clone a qmk_firmware fork.')
|
||||
def clone(cli):
|
||||
if not cli.args.destination:
|
||||
cli.args.destination = os.path.join(os.environ['ORIG_CWD'], default_fork.split('/')[-1])
|
||||
|
||||
qmk_firmware = Path(cli.args.destination)
|
||||
git_url = '/'.join((cli.config.clone.baseurl, cli.args.fork))
|
||||
|
||||
@@ -24,5 +27,5 @@ def clone(cli):
|
||||
cli.log.error('Destination already exists: %s', cli.args.destination)
|
||||
exit(1)
|
||||
|
||||
success = clone(git_url, cli.args.destination, cli.config.clone.branch)
|
||||
success = git_clone(git_url, cli.args.destination, cli.config.clone.branch)
|
||||
exit(0 if success else 1)
|
||||
|
||||
Reference in New Issue
Block a user