mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
projects-dir-minimal.mk: Default PROJECTS_DIR_REMOTE_BASE to jw-build's remote
If jw-build is already cloned, infect all other repositories with its remote via PROJECTS_DIR_REMOTE_BASE. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
561905bab7
commit
fc02dad92c
2 changed files with 12 additions and 3 deletions
|
|
@ -17,6 +17,7 @@ class CmdGetAuthInfo(Cmd): # export
|
|||
parser.add_argument('--only-values', help='Don\'t prefix values by "<field-name>="', action='store_true', default=False)
|
||||
parser.add_argument('--username', help='Show user name', action='store_true', default=False)
|
||||
parser.add_argument('--password', help='Show password', action='store_true', default=False)
|
||||
parser.add_argument('--remote-base', help='Show remote base URL', action='store_true', default=False)
|
||||
|
||||
def _run(self, args: Namespace) -> None:
|
||||
keys = ['username', 'password']
|
||||
|
|
@ -32,10 +33,14 @@ class CmdGetAuthInfo(Cmd): # export
|
|||
if re.match(r'^\s*$', line):
|
||||
continue
|
||||
name, url, typ = re.split(r'\s+', line)
|
||||
if name == 'origin' and typ == '(push)':
|
||||
if name == 'origin' and typ == '(pull)': # TODO: Use other remotes, too?
|
||||
parsed = urlparse(url)
|
||||
for key in keys:
|
||||
result[key] = getattr(parsed, key)
|
||||
base = parsed.geturl()
|
||||
base = re.sub(r'/jw-build', '', base)
|
||||
base = re.sub(r'/proj$', '', base)
|
||||
url['remote-base'] = base
|
||||
break
|
||||
|
||||
# --- Print results
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue