Skip to content

feat: support GitKraken on Linux #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"caption": "Git GUI Clients: Gitg",
"command": "ggc_open", "args": {"cmd": "gitg"}
},
{
"caption": "Git GUI Clients: GitKraken",
"command": "ggc_open", "args": {"cmd": "gitkraken", "beforePathOptions": "-p"}
},
{
"caption": "Git GUI Clients: SourceTree",
"command": "ggc_open", "args": {"cmd": "sourcetree"}
Expand Down
15 changes: 11 additions & 4 deletions Git GUI Clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ def get_excecutable(self, cmd):
# Fallback search on path
return shutil.which(os.path.basename(s.get(cmd)[0])) if s.get(cmd) else None

def is_enabled(self, cmd):
def is_enabled(self, **args):
cmd = str(args.get('cmd', ''))
return True if self.get_excecutable(cmd) else False

def run(self, cmd):
def run(self, **args):
cmd = str(args.get('cmd', ''))
beforePathOptions = str(args.get('beforePathOptions', ''))
# Get repository location and git gui client
excecutable = self.get_excecutable(cmd)
repository = self.get_git_repository()
Expand All @@ -62,5 +65,9 @@ def run(self, cmd):
print("Git GUI Clients: File/project is not in a Git repo.")
return

print("Git GUI Clients:", excecutable, repository)
subprocess.Popen(excecutable, cwd=repository, shell=True)
execArgs = excecutable
if beforePathOptions:
execArgs = execArgs + " " + beforePathOptions + " " + repository

print("Git GUI Clients:", execArgs, repository)
subprocess.Popen(execArgs, cwd=repository, shell=True)
3 changes: 3 additions & 0 deletions Git GUI Clients.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"gitg": [
"/usr/bin/gitg"
],
"gitkraken": [
"/usr/bin/gitkraken"
],
"sourcetree": [
"/usr/local/bin/stree"
]
Expand Down
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Clients. Supported viewer at the moment:
- Gitk
- GitExtensions
- Gitg
- GitKraken (Linux)
- SourceTree (OS X)

If you would like to see more, just fork the repository and add your favourite
Expand Down