@@ -32,20 +32,22 @@ import (
32
32
33
33
// projectRaw is a support struct used only to unmarshal the yaml
34
34
type projectRaw struct {
35
- ProfilesRaw yaml.Node `yaml:"profiles"`
36
- DefaultProfile string `yaml:"default_profile"`
37
- DefaultFqbn string `yaml:"default_fqbn"`
38
- DefaultPort string `yaml:"default_port,omitempty"`
39
- DefaultProtocol string `yaml:"default_protocol,omitempty"`
35
+ ProfilesRaw yaml.Node `yaml:"profiles"`
36
+ DefaultProfile string `yaml:"default_profile"`
37
+ DefaultFqbn string `yaml:"default_fqbn"`
38
+ DefaultPort string `yaml:"default_port,omitempty"`
39
+ DefaultProtocol string `yaml:"default_protocol,omitempty"`
40
+ DefaultProgrammer string `yaml:"default_programmer,omitempty"`
40
41
}
41
42
42
43
// Project represents the sketch project file
43
44
type Project struct {
44
- Profiles []* Profile
45
- DefaultProfile string
46
- DefaultFqbn string
47
- DefaultPort string
48
- DefaultProtocol string
45
+ Profiles []* Profile
46
+ DefaultProfile string
47
+ DefaultFqbn string
48
+ DefaultPort string
49
+ DefaultProtocol string
50
+ DefaultProgrammer string
49
51
}
50
52
51
53
// AsYaml outputs the sketch project file as YAML
@@ -69,6 +71,9 @@ func (p *Project) AsYaml() string {
69
71
if p .DefaultProtocol != "" {
70
72
res += fmt .Sprintf ("default_protocol: %s\n " , p .DefaultProtocol )
71
73
}
74
+ if p .DefaultProgrammer != "" {
75
+ res += fmt .Sprintf ("default_programmer: %s\n " , p .DefaultProgrammer )
76
+ }
72
77
return res
73
78
}
74
79
@@ -280,10 +285,11 @@ func LoadProjectFile(file *paths.Path) (*Project, error) {
280
285
return nil , err
281
286
}
282
287
return & Project {
283
- Profiles : profiles ,
284
- DefaultProfile : raw .DefaultProfile ,
285
- DefaultFqbn : raw .DefaultFqbn ,
286
- DefaultPort : raw .DefaultPort ,
287
- DefaultProtocol : raw .DefaultProtocol ,
288
+ Profiles : profiles ,
289
+ DefaultProfile : raw .DefaultProfile ,
290
+ DefaultFqbn : raw .DefaultFqbn ,
291
+ DefaultPort : raw .DefaultPort ,
292
+ DefaultProtocol : raw .DefaultProtocol ,
293
+ DefaultProgrammer : raw .DefaultProgrammer ,
288
294
}, nil
289
295
}
0 commit comments