From 0e9fd2a269ed7d918837672b3fef60470bc9902e Mon Sep 17 00:00:00 2001 From: Gyubong Date: Tue, 20 Sep 2022 09:17:57 +0900 Subject: [PATCH] Specify Builder flags --- .gitignore | 2 +- magefile.go | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0649410..016c79e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -alfred-chromium-workflow +alfred-chromium-workflow* cache _* diff --git a/magefile.go b/magefile.go index 0a18684..244f86e 100644 --- a/magefile.go +++ b/magefile.go @@ -1,3 +1,4 @@ +//go:build mage // +build mage package main @@ -46,4 +47,10 @@ func Clean() error { return sh.Run("mage", "-clean") } func Formatter() error { return sh.Run("gofmt", "-w", "src", "main.go") } -func Builder() error { return sh.Run("go", "build", ".") } +func Builder() error { + return sh.RunWith(map[string]string{ + "GOOS": "darwin", + "GOARCH": "amd64", + "CGO_ENABLED": "1", + }, "go", "build", "-o", "alfred-chromium-workflow", ".") +}