mage
mage copied to clipboard
Installation instructions don't work if run within a Go 1.11 module project directory
Steps to reproduce:
-
on a system without mage installed, clone a Go 1.11 module project that uses mage, e.g. https://github.com/dmolesUC3/cos
-
attempt to follow the installation instructions:
go get -u -d github.com/magefile/mage cd $GOPATH/src/github.com/magefile/mage # ← fails go run bootstrap.go
Expected:
- mage is installed
Actual:
-
cdfails with:-bash: cd: /Users/david/Projects/Go/src/github.com/magefile/mage: No such file or directory -
running
find $GOPATH -type d -name mageshows only:/Users/david/Projects/Go/pkg/mod/cache/download/github.com/magefile/mage /Users/david/Projects/Go/pkg/mod/github.com/magefile/[email protected]/mage
Workaround:
- change to a directory outside the project, e.g.
$HOME, and rerun the installation instructions from there
Proposed change:
- better installation instructions for users whose first exposure to mage is in the context of trying to build someone else's magefile-ized module project.
Oops, yeah, the instructions were updated for modules in the README on github, but not on the website. Thanks for pointing this out.
Try this:
git clone https://github.com/magefile/mage
cd mage
go run bootstrap.go
Using git clone seems bad to me. Wouldn't it be better to have mage installable by go install?