Skip to content

Commit 5db47dd

Browse files
fix(env): populate local env for later usage
resolves #230
1 parent 6e6fd34 commit 5db47dd

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/shell/env.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package shell
22

33
import (
4+
"os"
45
"strings"
56

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

119120
DotFile.WriteString(variable.string())
120121

122+
os.Setenv(variable.Name, variable.Value.(string))
123+
121124
first = false
122125
}
123126

src/shell/template.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ import (
1414
type Template string
1515

1616
func (t Template) Parse() Template {
17-
if value, err := parse(string(t), context.Current); err == nil {
18-
return Template(value)
17+
value, err := parse(string(t), context.Current)
18+
if err != nil {
19+
return t
1920
}
2021

21-
return t
22+
return Template(value)
2223
}
2324

2425
func (t Template) String() string {

0 commit comments

Comments
 (0)