-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9fd92ba
Showing
6 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SourcetreeCommand.pyc | ||
package-metadata.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{ "caption": "-" }, | ||
{ | ||
"caption": "SourceTree", | ||
"command": "sourcetree" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
{ | ||
"id": "tools", | ||
"children": | ||
[ | ||
{ | ||
"caption": "SourceTree", | ||
"command": "sourcetree" | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Sublime Text 2 - SourceTree menu plugin | ||
=============================================== | ||
|
||
Adds a handy menu item that opens [SourceTree](http://www.sourcetreeapp.com/). | ||
|
||
![screenshot](http://i.imgur.com/Td9aj.jpg) | ||
|
||
Adapted from the excellent [Github for mac](https://github.com/csytan/sublime-text-2-github) plugin for Sublime Text by Chris Tan | ||
|
||
Instructions | ||
------------- | ||
|
||
* Install [SourceTree](http://www.sourcetreeapp.com/) | ||
* Download [sublime-text-2-sourcetree](https://github.com/jocelynmallon/sublime-text-2-sourcetree/zipball/master) and copy unzipped folder to your Sublime Text 2 packages folder. | ||
* You can find your packages folder through the following menus: | ||
**Sublime Text 2** -> **Preferences** -> **Browse Packages** | ||
* Restart Sublime Text | ||
|
||
Usage | ||
----- | ||
* Open a file from a git repo in Sublime Text | ||
* Go to **Tools** -> **SourceTree** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import os | ||
import subprocess | ||
|
||
import sublime | ||
import sublime_plugin | ||
|
||
|
||
class SourcetreeCommand(sublime_plugin.WindowCommand): | ||
def run(self): | ||
filename = self.window.active_view().file_name() | ||
dirname = os.path.dirname(filename) | ||
while dirname != '/': | ||
if '.git' in os.listdir(dirname): | ||
return subprocess.call(['open', '-a', 'SourceTree', dirname]) | ||
dirname = os.path.dirname(dirname) | ||
subprocess.call(['open', '-a', 'SourceTree']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"schema_version": "1.1", | ||
"packages": [ | ||
{ | ||
"name": "SourceTree.app Menu", | ||
"author": "Jocelyn Mallon", | ||
"description": "Open SourceTree.app from your menu", | ||
"homepage": "https://github.com/jocelynmallon/sublime-text-2-sourcetree", | ||
"last_modified": "2012-05-01 12:45:30", | ||
"platforms": { | ||
"osx": [ | ||
{ | ||
"version": "1.0.0", | ||
"url": "https://github.com/jocelynmallon/sublime-text-2-sourcetree/zipball/master" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |