Skip to content

ionutivan/xcode-open-on-github

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xcode-open-on-github ⚙️

Quick Actions for Xcode to jump to a source code line on Github or Bitbucket, or copy a permalink to clipboard.

1️⃣ Open on Github

2️⃣ Copy GitHub link to clipboard

3️⃣ Open on Bitbucket

Works the same as Open on Github but constructs a Bitbucket source URL (/src/{commit}/{file}#lines-{start}:{end}).

4️⃣ Copy Bitbucket link to clipboard

Works the same as Copy GitHub link to clipboard but constructs a Bitbucket source URL.

Install

Just double-click the files in quick-actions directory to add them to the Services menu.

Pro Tip ®

You can create your own keyboard shortcuts for added actions:

  1. Open System Preferences > Keyboard. Click the Shortcuts tab and select Services from the list on the left side.
  2. Scroll all the way down the list of services. Under the Text heading you should find the quick actions you just added. Select it and click Add Shortcut to assign a global shortcut.

How it works?

Quick Actions for Xcode are AppleScript scripts. From the Xcode app we get a path of active document and selected lines. Using shell scripts we determine repository URL, current commit and top-level directory of a repository. All that allows constructing a GitHub link.

Verify Bitbucket copy workflow

Run:

bash tests/test_copy_bitbucket_workflow.sh

The test checks that the workflow script structure is valid and that URL generation works for common Bitbucket remote URL formats.

Author

Wojtek Lukaszuk @wojteklu

License

This project is licensed under the terms of the MIT license. See the license file.

About

Quick Actions for Xcode to jump to a source code line on Github or copy GitHub link to clipboard.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Shell 100.0%