Skip to content
Snippets Groups Projects
Commit 9f56a1f4 authored by Hugo Hörnquist's avatar Hugo Hörnquist
Browse files

git-open remote arg now works.

parent 23a489d5
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,11 @@ def warn(s):
def info(s):
print("\x1b[0;32mInfo\x1b[m " + s)
def open_remote(remote):
url = to_http(remote_url(remote))
xdg_open(url)
info(f'opening {url}')
def main(args):
out = popen("git remote")
remotes = out.strip().split("\n")
......@@ -54,11 +59,17 @@ def main(args):
if not remotes:
err("No remotes")
try:
open_remote(remote)
return
except Exception as e:
warn(str(e))
warn("Giving up")
return
for remote in remotes:
try:
url = to_http(remote_url(remote))
xdg_open(url)
info(f'opening {url}')
open_remote(remote)
break
except Exception as e:
warn(str(e))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment