mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
CmdGetAuthInfo: Don't use non-git jw-build
Don't try to use non-git jw-build repositories to retrieve auth info. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
bf6a83ccac
commit
f750b2cf05
1 changed files with 6 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import re
|
import re, os
|
||||||
from argparse import Namespace, ArgumentParser
|
from argparse import Namespace, ArgumentParser
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
|
|
@ -19,7 +19,11 @@ class CmdGetAuthInfo(Cmd): # export
|
||||||
parser.add_argument('--password', help='Show password', action='store_true', default=False)
|
parser.add_argument('--password', help='Show password', action='store_true', default=False)
|
||||||
|
|
||||||
def _run(self, args: Namespace) -> None:
|
def _run(self, args: Namespace) -> None:
|
||||||
remotes = run_cmd(['git', '-C', self.app.proj_dir('jw-build'), 'remote', '-v'])
|
jw_build_dir = self.app.proj_dir('jw-build')
|
||||||
|
if not os.path.isdir(jw_build_dir + '/.git'):
|
||||||
|
self.app.debug(f'jw-build directory is not a Git repo: {jw_build_dir}')
|
||||||
|
return
|
||||||
|
remotes = run_cmd(['git', '-C', jw_build_dir, 'remote', '-v'])
|
||||||
result: dict[str, str] = {}
|
result: dict[str, str] = {}
|
||||||
keys = ['username', 'password']
|
keys = ['username', 'password']
|
||||||
for line in remotes.split('\n'):
|
for line in remotes.split('\n'):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue