whyrusleeping / gx

A package management tool
MIT License
1.88k stars 110 forks source link

inconsistent argument handling #153

Closed djdv closed 6 years ago

djdv commented 6 years ago

At least on Windows (have not tried anything else yet), calling gx in any way besides standard invocation from PATH, causes gx to ignore some (maybe just sub-command) arguments. That is to say, if gx.exe is in /somedir/go/bin, and /somedir/go/bin is not in your PATH, and you call gx, it may ignore some arguments.

For example, any of these calls made inside a Go project

>%GOPATH%/bin/gx install --global
>/absolute-path-to/somedir/go/bin/gx.exe install --global
>relative-path-to/somedir/go/bin/gx install --global

will result in gx installing dependencies to the project's vendor directory, despite the fact that --global was passed.

However, appending to PATH and calling gx with the same arguments will not have this issues.

>SET PATH=%PATH%;%GOPATH%\bin
>gx install --global

Here is a video demonstrating this: http://ipfs.io/ipfs/zDMZof1kwwjKAExiBZM8u77852dXxU2Sy8woDtGZzYHeFL2DZyJT/Desktop%2001.08.2018%20-%2007.23.31.03.mp4

gx and gx-go were built from the current master (eba23c242e2b09d3b0e4cdac1609cd517202e9eb, https://github.com/whyrusleeping/gx-go/commit/d9a729ce207d50b210948a4ea4487ff67614fe6c) with standard go 1.9.2

whyrusleeping commented 6 years ago

@djdv thats likely because in most of those cases, gx can't find the gx-go binary.

Can you try out the code in this pr: https://github.com/whyrusleeping/gx/pull/150 and let me know if it works as expected?

djdv commented 6 years ago

Resolved in https://github.com/whyrusleeping/gx/pull/154