@@ -47,8 +47,8 @@ func (e exampleFlag) Set(value string) (err error) {
47
47
var (
48
48
examplesFlag = make (exampleFlag )
49
49
debugFlag bool
50
+ skipGitAddFlag bool
50
51
envFileFlag string
51
- logLevel = slog .LevelInfo
52
52
sampleFileFlag string
53
53
versionFlag bool
54
54
)
@@ -57,6 +57,7 @@ func init() {
57
57
flag .StringVar (& envFileFlag , "env-file" , ".env" , "set the path to your env file: ess -env-file=.env_file [sync|install]" )
58
58
flag .StringVar (& sampleFileFlag , "sample-file" , "env.sample" , "set the path to your sample file: ess -sample-file=env_var.sample [sync|install]" )
59
59
flag .BoolVar (& debugFlag , "debug" , false , "print debug logs: ess --debug [sync|install]" )
60
+ flag .BoolVar (& skipGitAddFlag , "skip-git-add" , false , "skip doing 'git add' on generated sample file after sync" )
60
61
flag .Var (examplesFlag , "example" , "set example values for samples: ess --example=BAR=\" my bar value\" [sync|install]" )
61
62
flag .BoolVar (& versionFlag , "version" , false , "print the current ess version: ess --version" )
62
63
@@ -92,6 +93,11 @@ func main() {
92
93
switch command {
93
94
case "sync" :
94
95
sync (projectPath )
96
+
97
+ if skipGitAddFlag {
98
+ return
99
+ }
100
+
95
101
cmd := exec .Command ("git" , "add" , filepath .Join (projectPath , sampleFileFlag ))
96
102
slog .Debug ("running git command" , "args" , cmd .Args )
97
103
err := cmd .Run ()
0 commit comments