From d02dd5e9da68fb4cb7bb4e8db5a16a4f7605558c Mon Sep 17 00:00:00 2001 From: Gintas Date: Tue, 14 Jul 2020 21:17:12 +0200 Subject: [PATCH] build: added option to run mage without installing it --- .travis.yml | 3 +-- README.md | 5 +---- mage.go | 12 ++++++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 mage.go diff --git a/.travis.yml b/.travis.yml index 61f9e40..f4dc99f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,12 +20,11 @@ os: install: - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.26.0 - - go get github.com/magefile/mage script: - go mod download - go mod verify - - mage -v check + - go run mage.go -v check after_success: - bash <(curl -s https://codecov.io/bash) diff --git a/README.md b/README.md index 35ad34d..12311ab 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,9 @@ To build a binary from the source code, you need to have [Go](https://golang.org **Steps**: 1. Clone repository: `git clone https://github.com/g1ntas/accio` -2. Build: `go build` +2. Build: `go run mage.go build` 3. Run `./accio` to verify if it works -**NOTE**: -While it’s the easiest way to build a binary, it doesn’t include any versioning information. For best results, use [Mage](https://magefile.org/) with `mage build`. - ## Quickstart ### Running generator You can run a generator from a local directory with `run` command: diff --git a/mage.go b/mage.go new file mode 100644 index 0000000..83d76c7 --- /dev/null +++ b/mage.go @@ -0,0 +1,12 @@ +// +build ignore + +package main + +import ( + "github.com/magefile/mage/mage" + "os" +) + +func main() { + os.Exit(mage.Main()) +}