File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,8 @@ func main() {
6767 return
6868 }
6969
70- commonEnv := [] string {
71- fmt . Sprintf ( "NOW= %s" , time . Now (). Format ( time . RFC3339 )),
70+ if err = SetupCommonEnv (); err != nil {
71+ log . Fatalf ( "setting up common env: %s" , err )
7272 }
7373
7474 modules := framework.Modules {}
@@ -81,7 +81,7 @@ func main() {
8181 modules [name ] = & framework.CommandModule [any ]{
8282 Command : module .Command ,
8383 Dir : module .Dir ,
84- Env : append ( commonEnv , module .Env ... ) ,
84+ Env : module .Env ,
8585 DependsOn : module .DependsOn ,
8686 }
8787 }
@@ -102,3 +102,14 @@ func ParseConfig(path string) (*CommandConfig, error) {
102102
103103 return cfg , nil
104104}
105+
106+ func SetupCommonEnv () error {
107+ for k , v := range map [string ]string {
108+ "NOW" : time .Now ().Format (time .RFC3339 ),
109+ } {
110+ if err := os .Setenv (k , v ); err != nil {
111+ return fmt .Errorf ("%q: %w" , k , err )
112+ }
113+ }
114+ return nil
115+ }
You can’t perform that action at this time.
0 commit comments