diff --git a/Default.sublime-commands b/Default.sublime-commands index 71c97a1..3f245ca 100644 --- a/Default.sublime-commands +++ b/Default.sublime-commands @@ -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"} diff --git a/Git GUI Clients.py b/Git GUI Clients.py index 15d022a..26ff2b4 100644 --- a/Git GUI Clients.py +++ b/Git GUI Clients.py @@ -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() @@ -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) diff --git a/Git GUI Clients.sublime-settings b/Git GUI Clients.sublime-settings index 66f4e20..19a1a84 100644 --- a/Git GUI Clients.sublime-settings +++ b/Git GUI Clients.sublime-settings @@ -15,6 +15,9 @@ "gitg": [ "/usr/bin/gitg" ], + "gitkraken": [ + "/usr/bin/gitkraken" + ], "sourcetree": [ "/usr/local/bin/stree" ] diff --git a/Readme.md b/Readme.md index a358d9a..1bb6ba9 100644 --- a/Readme.md +++ b/Readme.md @@ -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