Skip to content
This repository was archived by the owner on Jan 17, 2021. It is now read-only.

MSYS/MINGW Client Support (FINNALLY Working) #127

Closed
wants to merge 13 commits into from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ vendor
bin
.vscode
sshcode
sshcode.exe
4 changes: 4 additions & 0 deletions settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ func configDir() (string, error) {
path = os.ExpandEnv("$HOME/.config/Code/User/")
case "darwin":
path = os.ExpandEnv("$HOME/Library/Application Support/Code/User/")
case "windows":
path = os.ExpandEnv("/Users/$USERNAME/AppData/Roaming/Code/User")
default:
return "", xerrors.Errorf("unsupported platform: %s", runtime.GOOS)
}
Expand All @@ -39,6 +41,8 @@ func extensionsDir() (string, error) {
switch runtime.GOOS {
case "linux", "darwin":
path = os.ExpandEnv("$HOME/.vscode/extensions/")
case "windows":
path = os.ExpandEnv("/Users/$USERNAME/.vscode/extensions/")
default:
return "", xerrors.Errorf("unsupported platform: %s", runtime.GOOS)
}
Expand Down
9 changes: 7 additions & 2 deletions sshcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,14 @@ func openBrowser(url string) {
var openCmd *exec.Cmd

const (
macPath = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
wslPath = "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"
macPath = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
wslPath = "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"
msysPath = "/Program Files (x86)/Google/Chrome/Application/chrome.exe"
)

switch {
case commandExists("chrome"):
openCmd = exec.Command("chrome", chromeOptions(url)...)
case commandExists("google-chrome"):
openCmd = exec.Command("google-chrome", chromeOptions(url)...)
case commandExists("google-chrome-stable"):
Expand All @@ -254,6 +257,8 @@ func openBrowser(url string) {
openCmd = exec.Command(macPath, chromeOptions(url)...)
case pathExists(wslPath):
openCmd = exec.Command(wslPath, chromeOptions(url)...)
case pathExists(msysPath):
openCmd = exec.Command(msysPath, chromeOptions(url)...)
default:
err := browser.OpenURL(url)
if err != nil {
Expand Down