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

Windows WSL/MSYS path issues (fixes pr#127) #129

Closed

Description

@Merith-TK

I have narrowed down my error for to specifcally this
msysPath = "/c/'Program Files (x86)'/Google/Chrome/Application/chrome.exe"
(x86)
It seems to thing that it is trying to leave exec.Command() by using the ) from (x86)

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"
        msysPath = "/c/'Program Files (x86)'/Google/Chrome/Application/chrome.exe"
    )

    switch {
    case commandExists("google-chrome"):
        openCmd = exec.Command("google-chrome", chromeOptions(url)...)
    case commandExists("google-chrome-stable"):
        openCmd = exec.Command("google-chrome-stable", chromeOptions(url)...)
    case commandExists("chromium"):
        openCmd = exec.Command("chromium", chromeOptions(url)...)
    case commandExists("chromium-browser"):
        openCmd = exec.Command("chromium-browser", chromeOptions(url)...)
    case pathExists(macPath):
        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 {
            flog.Error("failed to open browser: %v", err)
        }
        return
    }
}

the most annoying thing is, I KNOW THE DAMNED ERROR, I dont know how to fracking FIX IT!
THis is what is holding back #127 from being pushed to mainstream

Activity

  1. Merith-TK commented on Jul 30, 2019

    @Merith-TK
    ContributorAuthor

    Found out the error,
    /c/ would work if it was WSL using that as it would use the Linux Go Runtime,
    i was working with the WINDOWS GO runtime so i had to change the path to
    msysPath = "/Program Files (x86)/Google/Chrome/Application/chrome.exe"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions