Skip to content

Commit

Permalink
fix(env): populate local env for later usage
Browse files Browse the repository at this point in the history
resolves #230
  • Loading branch information
JanDeDobbeleer committed Dec 31, 2024
1 parent 6e6fd34 commit 5db47dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/shell/env.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package shell

import (
"os"
"strings"

"github.com/jandedobbeleer/aliae/src/context"
Expand Down Expand Up @@ -118,6 +119,8 @@ func (e Envs) Render() {

DotFile.WriteString(variable.string())

os.Setenv(variable.Name, variable.Value.(string))

first = false
}

Expand Down
7 changes: 4 additions & 3 deletions src/shell/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import (
type Template string

func (t Template) Parse() Template {
if value, err := parse(string(t), context.Current); err == nil {
return Template(value)
value, err := parse(string(t), context.Current)
if err != nil {
return t
}

return t
return Template(value)
}

func (t Template) String() string {
Expand Down

0 comments on commit 5db47dd

Please sign in to comment.