From e84bbc1d92d4f939659e19908a45fa54a4278e23 Mon Sep 17 00:00:00 2001 From: Miro Date: Mon, 1 Nov 2021 15:27:29 +0000 Subject: [PATCH] #288 add brew and scoop install to docs (#376) Co-authored-by: Nate Finch --- site/content/index.md | 33 +++++++++++++++++++-------- site/content/zeroInstall/_index.en.md | 4 ++-- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/site/content/index.md b/site/content/index.md index dc12a809..bf9e33be 100644 --- a/site/content/index.md +++ b/site/content/index.md @@ -7,13 +7,14 @@ title = "Mage" Mage is a make/rake-like build tool using Go. You write plain-old go functions, and Mage automatically uses them as Makefile-like runnable targets. - ## Installation +### From GitHub source (any OS) + Mage has no dependencies outside the Go standard library, and builds with Go 1.7 -and above (possibly even lower versions, but they're not regularly tested). +and above (possibly even lower versions, but they're not regularly tested). -**Using Go Modules (Recommended)** +#### Using Go Modules (Recommended) ```plain git clone https://github.com/magefile/mage @@ -21,7 +22,7 @@ cd mage go run bootstrap.go ``` -**Using GOPATH** +#### Using GOPATH ```plain go get -u -d github.com/magefile/mage @@ -33,14 +34,28 @@ This will download the code into your GOPATH, and then run the bootstrap script to build mage with version infomation embedded in it. A normal `go get` (without -d) will build the binary correctly, but no version info will be embedded. If you've done this, no worries, just go to -$GOPATH/src/github.com/magefile/mage and run `mage install` or `go run +`$GOPATH/src/github.com/magefile/mage` and run `mage install` or `go run bootstrap.go` and a new binary will be created with the correct version information. The mage binary will be created in your $GOPATH/bin directory. +### From GitHub releases (any OS) + You may also install a binary release from our -[releases](https://github.com/magefile/mage/releases) page. +[releases](https://github.com/magefile/mage/releases) page. + +### With Homebrew (MacOS) + +`brew install mage` + +See [mage homebrew formula](https://formulae.brew.sh/formula/mage). + +### With Scoop (Windows) + +`scoop install mage` + +See [scoop](https://scoop.sh/). ## Example Magefile @@ -72,7 +87,6 @@ Run the above `Build` target by simply running `mage build` in the same director Join the `#mage` channel on [gophers slack](https://gophers.slack.com/messages/general/) for discussion of usage, development, etc. - ## Plugins There are no plugins. You don't need plugins. It's just Go code. You can @@ -80,6 +94,7 @@ import whatever libraries you want. Every library in the go ecosystem is a mage plugin. Every tool you use with Go can be used with Magefiles. ## Usage + ```plain mage [options] [target] @@ -101,7 +116,7 @@ Options: -f force recreation of compiled magefile -goarch sets the GOARCH for the binary created by -compile (default: current arch) -gocmd - use the given go binary to compile the output (default: "go") + use the given go binary to compile the output (default: "go") -goos sets the GOOS for the binary created by -compile (default: current OS) -h show description of a target -keep keep intermediate mage files around after running @@ -110,7 +125,7 @@ Options: -v show verbose output when running mage targets -w working directory where magefiles will run (default -d value) - ``` +``` ## Why? diff --git a/site/content/zeroInstall/_index.en.md b/site/content/zeroInstall/_index.en.md index d7f60054..d239a047 100644 --- a/site/content/zeroInstall/_index.en.md +++ b/site/content/zeroInstall/_index.en.md @@ -21,8 +21,8 @@ Now you can `go run mage.go ` and it'll work just as if you ran package main import ( - "os" - "github.com/magefile/mage/mage" + "os" + "github.com/magefile/mage/mage" ) func main() { os.Exit(mage.Main()) }