diff --git a/magefile.go b/magefile.go index 329de5fc0..794c5701f 100644 --- a/magefile.go +++ b/magefile.go @@ -18,12 +18,19 @@ package main import ( - "github.com/magefile/mage/sh" + "fmt" + // mage:import _ "github.com/ZupIT/horusec-devkit/pkg/utils/mageutils" + "github.com/magefile/mage/sh" ) // GetCurrentDate execute "echo", `::set-output name=date::$(date "+%a %b %d %H:%M:%S %Y")` func GetCurrentDate() error { - return sh.RunV("echo", `::set-output name=date::$(date "+%a %b %d %H:%M:%S %Y")`) + date, err := sh.Output("date", "+%a %b %d %H:%M:%S %Y") + if err != nil { + return err + } + + return sh.RunV("echo", fmt.Sprintf("::set-output name=date::%s", date)) }