Skip to content

Commit

Permalink
Enhancement: get remote url from api call
Browse files Browse the repository at this point in the history
  • Loading branch information
randy3k authored and stoivo committed Apr 11, 2018
1 parent 14dd799 commit a3214c6
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions github/commands/create_fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,21 @@ def run_async(self):
base_remote = github.parse_remote(self.get_integrated_remote_url())
self.window.status_message(START_CREATE_MESSAGE.format(repo=base_remote))
result = github.create_fork(base_remote)
self.clone_url = result["clone_url"] if "clone_url" in result else None
self.ssh_url = result["ssh_url"] if "ssh_url" in result else None
self.window.status_message(END_CREATE_MESSAGE)
util.debug.add_to_log(("github: fork result:\n{}".format(result)))
self.window.show_quick_panel(
["Fork created, do you want to add it as remote?",
"Yes",
"No"],
["Add fork as remote?",
self.clone_url,
self.ssh_url],
self.on_select_action
)

def on_select_action(self, idx):
if idx != 1:
if idx == 0:
return

self.window.run_command("gs_add_fork_as_remote",)
elif idx == 1:
self.window.run_command("gs_remote_add", {"url": self.clone_url})
elif idx == 2:
self.window.run_command("gs_remote_add", {"url": self.ssh_url})

0 comments on commit a3214c6

Please sign in to comment.