Skip to content

Commit

Permalink
example magefile on main site page
Browse files Browse the repository at this point in the history
  • Loading branch information
natefinch committed Dec 10, 2018
1 parent 98264f3 commit bddeffb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions site/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ The mage binary will be created in your $GOPATH/bin directory.
You may also install a binary release from our
[releases](https://github.com/magefile/mage/releases) page.

## Example Magefile

```go
//+build mage

package main

// Runs dep ensure and then installs the binary.
func Build() error {
if err := sh.Run("dep", "ensure"); err != nil {
return err
}
return sh.Run("go", "install", "./...")
}
```

Run the above `Build` target by simply running `mage build` in the same directory as the magefile.

## Demo

{{< youtube Hoga60EF_1U >}}
Expand Down

0 comments on commit bddeffb

Please sign in to comment.