@@ -73,47 +73,47 @@ func initVals() {
73
73
if _, exists = os.LookupEnv("EASYGEN_HTML"); Opts.HTML|| exists {
74
74
Opts.HTML = true
75
75
}
76
- if len(Opts.TemplateStr) == 0 ||
76
+ if len(Opts.TemplateStr) == 0 &&
77
77
len(os.Getenv("EASYGEN_TS")) != 0 {
78
78
Opts.TemplateStr = os.Getenv("EASYGEN_TS")
79
79
}
80
- if len(Opts.TemplateFile) == 0 ||
80
+ if len(Opts.TemplateFile) == 0 &&
81
81
len(os.Getenv("EASYGEN_F")) != 0 {
82
82
Opts.TemplateFile = os.Getenv("EASYGEN_F")
83
83
}
84
- if len(Opts.TemplateFile) == 0 ||
84
+ if len(Opts.TemplateFile) == 0 &&
85
85
len(os.Getenv("EASYGEN_TF")) != 0 {
86
86
Opts.TemplateFile = os.Getenv("EASYGEN_TF")
87
87
}
88
- if len(Opts.ExtYaml) == 0 ||
88
+ if len(Opts.ExtYaml) == 0 &&
89
89
len(os.Getenv("EASYGEN_EY")) != 0 {
90
90
Opts.ExtYaml = os.Getenv("EASYGEN_EY")
91
91
}
92
- if len(Opts.ExtTmpl) == 0 ||
92
+ if len(Opts.ExtTmpl) == 0 &&
93
93
len(os.Getenv("EASYGEN_ET")) != 0 {
94
94
Opts.ExtTmpl = os.Getenv("EASYGEN_ET")
95
95
}
96
- if len(Opts.StrFrom) == 0 ||
96
+ if len(Opts.StrFrom) == 0 &&
97
97
len(os.Getenv("EASYGEN_RF")) != 0 {
98
98
Opts.StrFrom = os.Getenv("EASYGEN_RF")
99
99
}
100
- if len(Opts.StrTo) == 0 ||
100
+ if len(Opts.StrTo) == 0 &&
101
101
len(os.Getenv("EASYGEN_RT")) != 0 {
102
102
Opts.StrTo = os.Getenv("EASYGEN_RT")
103
103
}
104
- if Opts.IntV == 0 ||
104
+ if Opts.IntV == 0 &&
105
105
len(os.Getenv("EASYGEN_INTV")) != 0 {
106
106
if i, err := strconv.Atoi(os.Getenv("EASYGEN_INTV")); err == nil {
107
107
Opts.IntV = i
108
108
}
109
109
}
110
- if Opts.Debug == 0 ||
110
+ if Opts.Debug == 0 &&
111
111
len(os.Getenv("EASYGEN_D")) != 0 {
112
112
if i, err := strconv.Atoi(os.Getenv("EASYGEN_D")); err == nil {
113
113
Opts.Debug = i
114
114
}
115
115
}
116
- if Opts.Debug == 0 ||
116
+ if Opts.Debug == 0 &&
117
117
len(os.Getenv("EASYGEN_DEBUG")) != 0 {
118
118
if i, err := strconv.Atoi(os.Getenv("EASYGEN_DEBUG")); err == nil {
119
119
Opts.Debug = i
0 commit comments