@@ -33,19 +33,19 @@ var tr = i18n.Tr
33
33
// to execute further operations a valid Instance is mandatory.
34
34
// If Init returns errors they're printed only.
35
35
func CreateAndInit () * rpc.Instance {
36
- inst , _ := CreateAndInitWithProfile ("" , nil )
36
+ inst , _ := CreateAndInitWithProfile ("" , nil , false )
37
37
return inst
38
38
}
39
39
40
40
// CreateAndInitWithProfile returns a new initialized instance using the given profile of the given sketch.
41
41
// If Create fails the CLI prints an error and exits since to execute further operations a valid Instance is mandatory.
42
42
// If Init returns errors they're printed only.
43
- func CreateAndInitWithProfile (profileName string , sketchPath * paths.Path ) (* rpc.Instance , * rpc.Profile ) {
43
+ func CreateAndInitWithProfile (profileName string , sketchPath * paths.Path , defaultProfile bool ) (* rpc.Instance , * rpc.Profile ) {
44
44
instance , err := Create ()
45
45
if err != nil {
46
46
feedback .Fatal (tr ("Error creating instance: %v" , err ), feedback .ErrGeneric )
47
47
}
48
- profile := InitWithProfile (instance , profileName , sketchPath )
48
+ profile := InitWithProfile (instance , profileName , sketchPath , defaultProfile )
49
49
return instance , profile
50
50
}
51
51
@@ -64,13 +64,13 @@ func Create() (*rpc.Instance, error) {
64
64
// Package and library indexes files are automatically updated if the
65
65
// CLI is run for the first time.
66
66
func Init (instance * rpc.Instance ) {
67
- InitWithProfile (instance , "" , nil )
67
+ InitWithProfile (instance , "" , nil , false )
68
68
}
69
69
70
70
// InitWithProfile initializes instance by loading libraries and platforms specified in the given profile of the given sketch.
71
71
// In case of loading failures return a list of errors for each platform or library that we failed to load.
72
72
// Required Package and library indexes files are automatically downloaded.
73
- func InitWithProfile (instance * rpc.Instance , profileName string , sketchPath * paths.Path ) * rpc.Profile {
73
+ func InitWithProfile (instance * rpc.Instance , profileName string , sketchPath * paths.Path , defaultProfile bool ) * rpc.Profile {
74
74
// In case the CLI is executed for the first time
75
75
if err := FirstUpdate (instance ); err != nil {
76
76
feedback .Warning (tr ("Error initializing instance: %v" , err ))
@@ -84,6 +84,7 @@ func InitWithProfile(instance *rpc.Instance, profileName string, sketchPath *pat
84
84
if sketchPath != nil {
85
85
initReq .SketchPath = sketchPath .String ()
86
86
initReq .Profile = profileName
87
+ initReq .DefaultProfile = defaultProfile
87
88
}
88
89
var profile * rpc.Profile
89
90
err := commands .Init (initReq , func (res * rpc.InitResponse ) {
0 commit comments