File tree 3 files changed +14
-2
lines changed 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,11 @@ func initUpdateIndexCommand() *cobra.Command {
44
44
func runUpdateIndexCommand (cmd * cobra.Command , args []string ) {
45
45
inst := instance .CreateInstanceAndRunFirstUpdate ()
46
46
logrus .Info ("Executing `arduino-cli core update-index`" )
47
+ UpdateIndex (inst )
48
+ }
47
49
50
+ // UpdateIndex updates the index of platforms.
51
+ func UpdateIndex (inst * rpc.Instance ) {
48
52
err := commands .UpdateIndex (context .Background (), & rpc.UpdateIndexRequest {Instance : inst }, output .ProgressBar ())
49
53
if err != nil {
50
54
feedback .Error (err )
Original file line number Diff line number Diff line change @@ -44,7 +44,11 @@ func initUpdateIndexCommand() *cobra.Command {
44
44
func runUpdateIndexCommand (cmd * cobra.Command , args []string ) {
45
45
inst := instance .CreateInstanceAndRunFirstUpdate ()
46
46
logrus .Info ("Executing `arduino-cli lib update-index`" )
47
+ UpdateIndex (inst )
48
+ }
47
49
50
+ // UpdateIndex updates the index of libraries.
51
+ func UpdateIndex (inst * rpc.Instance ) {
48
52
err := commands .UpdateLibrariesIndex (context .Background (), & rpc.UpdateLibrariesIndexRequest {
49
53
Instance : inst ,
50
54
}, output .ProgressBar ())
Original file line number Diff line number Diff line change @@ -46,13 +46,17 @@ func initUpgradeCommand() *cobra.Command {
46
46
func runUpgradeCommand (cmd * cobra.Command , args []string ) {
47
47
instance := instance .CreateAndInit ()
48
48
logrus .Info ("Executing `arduino-cli lib upgrade`" )
49
+ Upgrade (instance , args )
50
+ }
49
51
52
+ // Upgrade upgrades the specified libraries
53
+ func Upgrade (instance * rpc.Instance , libraries []string ) {
50
54
var upgradeErr error
51
- if len (args ) == 0 {
55
+ if len (libraries ) == 0 {
52
56
req := & rpc.LibraryUpgradeAllRequest {Instance : instance }
53
57
upgradeErr = lib .LibraryUpgradeAll (req , output .ProgressBar (), output .TaskProgress ())
54
58
} else {
55
- for _ , libName := range args {
59
+ for _ , libName := range libraries {
56
60
req := & rpc.LibraryUpgradeRequest {
57
61
Instance : instance ,
58
62
Name : libName ,
You can’t perform that action at this time.
0 commit comments