summaryrefslogtreecommitdiff
path: root/run/run.go
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-04-14 18:05:59 +0200
committerewy <ewy0@protonmail.com>2026-04-14 18:05:59 +0200
commit6b8c39143f8375680e260e5f8f204e4cf9031599 (patch)
tree1fa7d91150ad7d8c56c2e96b689f866f71bfc256 /run/run.go
parentcc5a07dfc115b9a4e97854501fdd26c9ebd5b8d0 (diff)
add loading of .env files
Diffstat (limited to 'run/run.go')
-rw-r--r--run/run.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/run/run.go b/run/run.go
index 26d2913..d175823 100644
--- a/run/run.go
+++ b/run/run.go
@@ -3,6 +3,7 @@ package run
import (
"fmt"
"os"
+ "pik/env"
"pik/flags"
"pik/menu"
"pik/model"
@@ -91,6 +92,11 @@ func Exec(source *model.Source, target model.Target, args ...string) error {
cmd.Stderr = os.Stderr
cmd.Args = append(cmd.Args, args...)
+ e := env.Get(source)
+ if len(e) > 0 {
+ cmd.Env = append(os.Environ(), e...)
+ }
+
if *flags.Dry {
_, _ = fmt.Fprintln(os.Stderr, menu.InlineCmd(cmd))
return nil