divan / gofresh

Keep your Go package dependencies fresh. Console tool for checking and updating package dependencies (imports).
141 stars 6 forks source link

GOPATH() fails on Windows due to colon #7

Closed christophberger closed 8 years ago

christophberger commented 9 years ago

This line in func GOPATH() fails on Windows machines:

return r == ':'

Given a %GOPATH% like

C:\Users\aUser\go

GOPATH() splits %GOPATH% at the colon and uses "C" as the GOPATH, causing the gofresh command to fail with an error message:

>gofresh
Found 21 imports, checking for updates...
←[31mgithub.com/pkg/profile←[0m: ←[31;1mchdir C\src\github.com\pkg\profile: The system cannot find the path specified.←[0m

(Side note - cmd.exe seems to not understand the control codes (like "←[31m" etc). Just a cosmetic problem and not related to this issue..)

vibbix commented 9 years ago

I added a pull request to fix the first issue. I'll see what I can do about the control codes.

divan commented 9 years ago

Oh, don't know why I missed this issue. Both issues are solvable. Thanks, @vibbix, I'll take a look now. About control codes, there is a nice package by mattn called go-colorable, which supports windows colors in terminal. I'll use it.

divan commented 9 years ago

Added color support for windows in https://github.com/divan/gofresh/commit/a1f0f685800a9924fe3efe1b9c4d4eda7acfd9e5 . Can you please check it in windows? (I don't have one)

Also, try to run it with TRUTH_MODE env arg against package that has some updates :)

christophberger commented 8 years ago

My apologies for the late response. I see the fix for this issue is already in the master branch. I did a few tests and the gopath error does not occur anymore on my end. So if everyone agrees, I guess this issue can be closed. Thanks