Open codehearts opened 6 years ago
An option is to have fallback, which triggers if previous method does not return correct path. For example, default is as is now and if that fails your code gets executed.
If the last command prints a path name (git status
), then the existing code thinks that path is the cwd and the fallback won't run. Otherwise that would work.
On top of that, cygpath
needs to be run if using Git for Windows, but not if Git was installed through Cygwin :weary: You can at least tell if it's Git for Windows by checking if git --version
contains "windows" (git version 2.16.1.windows.1
)
I can try to get a PR together that checks these conditions, the code in my original post is too specific to my setup.
This works only problem is that when I cd out of the repository the statusline still shows the same branch with the all the git numbers from the previous repo, even if you cd into another repo,
This works if you directly open hyper from the respective repo, Is there anyone who has solved this.
I'm on 64bit Windows 7 with cygwin32, Git Bash, and Hyper 1.4.8. The statusline shows nothing until I run a command like
git status
with unstaged changes, then it shows the first path in the output as my cwd with no Git info.I actually found a workaround for this, by replacing the logic for win32 in
setCwd
with the followingWhile this works for cygwin with Git Bash installed separately, I'm not sure if this works for Cygwin using Cygwin's Git, or if it would work for Git Bash/MinGW. I'm also not sure how you could detect Cygwin or other setups from the plugin.