Created
March 1, 2017 08:05
-
-
Save BBlackwo/b4fec2c0e6d1c6ade21fcbc1511255eb to your computer and use it in GitHub Desktop.
Open GitKraken from the terminal
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
## Forked from https://gist.github.com/dersam/0ec781e8fe552521945671870344147b | |
## Also received help from https://twitter.com/gitkraken/status/691675309725368321 | |
## Open GitKraken using the current repo directory. | |
## This code is for fish shell. The same thing can be done in bash | |
## by creating an alias with the command below. | |
## `1>/dev/null` directs logs from the terminal | |
## `&` allows use of the same terminal instance to do other things | |
## Note: If you're not using OSX, the path is definitely different. | |
function kraken | |
set dir $argv[1] (pwd) # use a directory if you pass it in, otherwise cwd | |
/Applications/GitKraken.app/Contents/MacOS/GitKraken -p $dir 1>/dev/null & | |
end | |
## Now you can simply run `kraken` from your git repo directory. | |
## Optionally specify the directory of your git repo as the first parameter. |
would you please, help me to customize it for zsh
i tried
gitkraken() {
set dir $1 (pwd)
/Applications/GitKraken.app/Contents/MacOS/GitKraken -p $dir 1>/dev/null &
}
but it tell me
gitkraken:1: number expected
for zsh, i added this to .zshrc
gitkraken() {
if [ "$1" != "" ]
then
/Applications/GitKraken.app/Contents/MacOS/GitKraken -p $1 1>/dev/null &
else
/Applications/GitKraken.app/Contents/MacOS/GitKraken -p . 1>/dev/null &
fi
}
and it worked
the problem with this one is that after closing gitkraken
zsh is using 100% CPU
i don't now where is the problem
I wrote a version in go go get github.com/mrexodia/kraken
What the difference between this gist and https://gist.github.com/dersam/0ec781e8fe552521945671870344147b ?
@skywinder this is a forked version for fish shell. That one is for z shell.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using Ubuntu 16.10 and I have Git Kraken 2.5.0 installed, so I don't need to create a new function because if I execute gitkraken into terminal the app will run.