@@ -33,19 +33,19 @@ var tr = i18n.Tr
3333// to execute further operations a valid Instance is mandatory.
3434// If Init returns errors they're printed only.
3535func CreateAndInit () * rpc.Instance {
36- inst , _ := CreateAndInitWithProfile ("" , nil )
36+ inst , _ := CreateAndInitWithProfile ("" , nil , false )
3737 return inst
3838}
3939
4040// CreateAndInitWithProfile returns a new initialized instance using the given profile of the given sketch.
4141// If Create fails the CLI prints an error and exits since to execute further operations a valid Instance is mandatory.
4242// 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 ) {
4444 instance , err := Create ()
4545 if err != nil {
4646 feedback .Fatal (tr ("Error creating instance: %v" , err ), feedback .ErrGeneric )
4747 }
48- profile := InitWithProfile (instance , profileName , sketchPath )
48+ profile := InitWithProfile (instance , profileName , sketchPath , defaultProfile )
4949 return instance , profile
5050}
5151
@@ -64,13 +64,13 @@ func Create() (*rpc.Instance, error) {
6464// Package and library indexes files are automatically updated if the
6565// CLI is run for the first time.
6666func Init (instance * rpc.Instance ) {
67- InitWithProfile (instance , "" , nil )
67+ InitWithProfile (instance , "" , nil , false )
6868}
6969
7070// InitWithProfile initializes instance by loading libraries and platforms specified in the given profile of the given sketch.
7171// In case of loading failures return a list of errors for each platform or library that we failed to load.
7272// 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 {
7474 // In case the CLI is executed for the first time
7575 if err := FirstUpdate (instance ); err != nil {
7676 feedback .Warning (tr ("Error initializing instance: %v" , err ))
@@ -84,6 +84,7 @@ func InitWithProfile(instance *rpc.Instance, profileName string, sketchPath *pat
8484 if sketchPath != nil {
8585 initReq .SketchPath = sketchPath .String ()
8686 initReq .Profile = profileName
87+ initReq .DefaultProfile = defaultProfile
8788 }
8889 var profile * rpc.Profile
8990 err := commands .Init (initReq , func (res * rpc.InitResponse ) {
0 commit comments