read-only-coding icon indicating copy to clipboard operation
read-only-coding copied to clipboard

Error if no remote named origin

Open rnkyr opened this issue 6 years ago • 4 comments

Hi, @1ec5! I'm looking forward to start using your script. But, unfortunately, I can't Every time I'm trying to use it alert pops-up with text: There is no application set to open the URL /blob/fc06c53be87c67b74b3dfa14e44356280c54700f/ProjectDir/Flows/Feed/Feed.swift#L12. Probably I need to setup some bindings for such scheme. Could you help me with that?

rnkyr avatar Aug 07 '18 09:08 rnkyr

This workflow assumes your clone’s GitHub remote is named origin, since that’s what GitHub recommends by default. Is the remote called something else in your clone? If so, then there would be no base URL to append the blob path to. Since the resulting string starts with a slash, the system thinks the workflow is trying to open an absolute path to a nonexistent local file rather than a URL.

https://github.com/1ec5/read-only-coding/blob/bc136b778fb923e064f5f7dde3799fbe78c17626/Open%20Selection%20in%20GitHub.workflow/Contents/document.wflow#L405

1ec5 avatar Aug 07 '18 15:08 1ec5

yep, that's my case. I got three remotes and no origin. Ok, thank you for pointing that out

rnkyr avatar Aug 07 '18 15:08 rnkyr

Ok, I set origin. Now I got a similar message, but with There is no application set to open the URL git@gitlab text. Looks like http here is required, right?

rnkyr avatar Aug 07 '18 15:08 rnkyr

I got three remotes and no origin.

OK, in that case, the workflow should probably look for a github.com remote and prompt you to select one if there’s more than one, similar to how it prompts when there are multiple files open in Xcode with the same file name. Let’s track that enhancement in this issue.

There is no application set to open the URL git@gitlab

Currently this workflow only knows how to open files in GitHub when the remote uses an HTTPS URL. Let’s track SSH support in #4 and GitLab.com support in #5.

1ec5 avatar Aug 07 '18 16:08 1ec5