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 (#876)

Signed-off-by: Nathan Martins <nathan.martins@zup.com.br>
(cherry picked from commit 2937c65)
  • Loading branch information
nathanmartinszup committed Dec 15, 2021
1 parent ee72d9f commit 42360a7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

0 comments on commit 42360a7

Please sign in to comment.