Skip to content

Commit

Permalink
mage:bugfix - fixing error that cli date was being print equal the da…
Browse files Browse the repository at this point in the history
…te command (ZupIT#876)

Signed-off-by: Nathan Martins <[email protected]>
  • Loading branch information
nathanmartinszup authored Dec 15, 2021
1 parent bf20250 commit 2937c65
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package main

import (
"fmt"

// mage:import
_ "github.com/ZupIT/horusec-devkit/pkg/utils/mageutils"
Expand All @@ -26,5 +27,10 @@ import (

// 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))
}

0 comments on commit 2937c65

Please sign in to comment.