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
ubuntu 1804 with zsh shows "sh: 8: [[: not found" #57
Comments
hmm, it shouldn't be showing that error like that anymore. It looks like you're up to date in terms of the lazygit repo. Could you try running |
you shouldn't be using |
Seeing same issue on f8ca0dd with ubuntu 1804 (using fish shell, not zsh, but |
The culprit is this script here which gets your branches in reverse chronological order along with their relative last commit time.
It's probably the weakest part of the codebase, not the least because it hasn't been written in go. If anybody can put up a PR that cleans this guy up or refactors it out into just git commands and Go, I would very much appreciate it! I'll spend some time right now seeing if I can refactor it |
The following patch seems to have been enough to get the software up and running for me, should anyone want a stopgap until a proper fix is available: diff --git a/gitcommands.go b/gitcommands.go
index 50c1f2a..63d2ffa 100644
--- a/gitcommands.go
+++ b/gitcommands.go
@@ -116,7 +116,7 @@ func platformShell() (string, string) {
if runtime.GOOS == "windows" {
return "cmd", "/c"
}
- return "sh", "-c"
+ return "bash", "-c"
}
func runDirectCommand(command string) (string, error) { |
thanks @tswsl1989 :) I switched to sh thinking it would increase compatibility but it seems it's had the opposite effect! I've added that change to the PR that should fix the underlying issue here #60 |
Beware, the go installer still install the buggy version (I tried a few minutes ago). And, going to |
@perror I just merged the PR to master, that ugly bash script is now out of the codebase. Let me know if there are still any issues |
It works like a charm now! :) Just did a |
you should revert to using |
This issue seems to be resolved, tested on 16.04 after this referenced pull request merge. |
problem solved after update to latest version:) Thanks @jesseduffield ! |
Hi, I got "sh: 8: [[: not found" in branches section and top of the window. zsh version zsh 5.4.2 (x86_64-ubuntu-linux-gnu). lazygit is on b80e811. How can I fix that error?
The text was updated successfully, but these errors were encountered: