|
55 | 55 | optimizeForDebug bool // Optimize compile output for debug, not for release |
56 | 56 | programmer string // Use the specified programmer to upload |
57 | 57 | clean bool // Cleanup the build folder and do not use any cached build |
58 | | - exportBinaries bool // Copies compiled binaries to sketch folder when true |
59 | 58 | compilationDatabaseOnly bool // Only create compilation database without actually compiling |
60 | 59 | sourceOverrides string // Path to a .json file that contains a set of replacements of the sketch source code. |
61 | 60 | ) |
@@ -100,8 +99,7 @@ func NewCommand() *cobra.Command { |
100 | 99 | command.Flags().StringVarP(&programmer, "programmer", "P", "", "Optional, use the specified programmer to upload.") |
101 | 100 | command.Flags().BoolVar(&compilationDatabaseOnly, "only-compilation-database", false, "Just produce the compilation database, without actually compiling.") |
102 | 101 | command.Flags().BoolVar(&clean, "clean", false, "Optional, cleanup the build folder and do not use any cached build.") |
103 | | - // We must use the following syntax for this flag since it's also bound to settings, we could use the other one too |
104 | | - // but it wouldn't make sense since we still must explicitly set the exportBinaries variable by reading from settings. |
| 102 | + // We must use the following syntax for this flag since it's also bound to settings. |
105 | 103 | // This must be done because the value is set when the binding is accessed from viper. Accessing from cobra would only |
106 | 104 | // read the value if the flag is set explicitly by the user. |
107 | 105 | command.Flags().BoolP("export-binaries", "e", false, "If set built binaries will be exported to the sketch folder.") |
@@ -137,11 +135,6 @@ func run(cmd *cobra.Command, args []string) { |
137 | 135 | } |
138 | 136 | } |
139 | 137 |
|
140 | | - // We must read this from settings since the value is set when the binding is accessed from viper, |
141 | | - // accessing it from cobra would only read it if the flag is explicitly set by the user and ignore |
142 | | - // the config file and the env vars. |
143 | | - exportBinaries = configuration.Settings.GetBool("sketch.always_export_binaries") |
144 | | - |
145 | 138 | var overrides map[string]string |
146 | 139 | if sourceOverrides != "" { |
147 | 140 | data, err := paths.New(sourceOverrides).ReadFile() |
@@ -176,7 +169,6 @@ func run(cmd *cobra.Command, args []string) { |
176 | 169 | Libraries: libraries, |
177 | 170 | OptimizeForDebug: optimizeForDebug, |
178 | 171 | Clean: clean, |
179 | | - ExportBinaries: exportBinaries, |
180 | 172 | CreateCompilationDatabaseOnly: compilationDatabaseOnly, |
181 | 173 | SourceOverride: overrides, |
182 | 174 | } |
|
0 commit comments