Skip to content

Commit 599cae3

Browse files
committed
Allow setting custom env values when calling sync
1 parent 50cb029 commit 599cae3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

main.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ func main() {
4848
Name: "sync",
4949
Aliases: []string{"s"},
5050
Usage: "Sync a repo right now",
51+
Flags: []cli.Flag{
52+
&cli.StringSliceFlag{
53+
Name: "env",
54+
Aliases: []string{"e"},
55+
Usage: "Env variables to pass",
56+
},
57+
},
5158
Action: func(ctx *cli.Context) error {
5259
repoPath, err := os.Getwd()
5360
if err != nil {
@@ -64,6 +71,10 @@ func main() {
6471
return tracerr.Wrap(err)
6572
}
6673

74+
for _, e := range ctx.StringSlice("env") {
75+
cfg.Env = append(cfg.Env, e)
76+
}
77+
6778
err = common.AutoSync(cfg)
6879
if err != nil {
6980
return tracerr.Wrap(err)

0 commit comments

Comments
 (0)