@@ -4,21 +4,17 @@ import (
44 "context"
55 "fmt"
66 "os"
7- "path"
87 "strconv"
98
109 "github.com/spf13/cobra"
1110 "golang.org/x/term"
1211
1312 "github.com/arduino/arduino-app-cli/cmd/feedback"
14- "github.com/arduino/arduino-app-cli/pkg/appsync"
1513 "github.com/arduino/arduino-app-cli/pkg/board"
1614 "github.com/arduino/arduino-app-cli/pkg/board/remote"
1715 "github.com/arduino/arduino-app-cli/pkg/board/remote/adb"
1816)
1917
20- const boardHomePath = "/home/arduino"
21-
2218type contextKey string
2319
2420const remoteConnKey contextKey = "remoteConn"
@@ -61,9 +57,6 @@ func NewBoardCmd() *cobra.Command {
6157 fsCmd .PersistentFlags ().StringVarP (& fqbn , "fqbn" , "b" , "arduino:zephyr:unoq" , "fqbn of the board" )
6258 fsCmd .PersistentFlags ().StringVar (& host , "host" , "" , "ADB host address" )
6359
64- fsCmd .AddCommand (newPushCmd ())
65- fsCmd .AddCommand (newPullCmd ())
66- fsCmd .AddCommand (newSyncAppCmd ())
6760 fsCmd .AddCommand (newBoardListCmd ())
6861 fsCmd .AddCommand (newBoardSetName ())
6962 fsCmd .AddCommand (newSetPasswordCmd ())
@@ -78,44 +71,6 @@ func NewBoardCmd() *cobra.Command {
7871 return fsCmd
7972}
8073
81- func newSyncAppCmd () * cobra.Command {
82- syncAppCmd := & cobra.Command {
83- Use : "enable-sync <path>" ,
84- Short : "Enable sync of an path from the board" ,
85- Args : cobra .ExactArgs (1 ),
86- RunE : func (cmd * cobra.Command , args []string ) error {
87- conn := cmd .Context ().Value (remoteConnKey ).(remote.RemoteConn )
88-
89- remote := path .Join (boardHomePath , args [0 ])
90-
91- s , err := appsync .New (conn )
92- if err != nil {
93- return fmt .Errorf ("failed to create apps sync: %w" , err )
94- }
95- defer s .Close ()
96- s .OnPull = func (name , path string ) {
97- feedback .Printf (" ⬆️ Pulled app %q to folder %q" , name , path )
98- }
99- s .OnPush = func (name string ) {
100- feedback .Printf (" ⬇️ Pushed app %q to the board" , name )
101- }
102-
103- tmp , err := s .EnableSyncApp (remote )
104- if err != nil {
105- return fmt .Errorf ("failed to enable sync for app %q: %w" , remote , err )
106- }
107-
108- feedback .Printf ("Enable sync of %q at %q" , remote , tmp )
109-
110- <- cmd .Context ().Done ()
111- _ = s .DisableSyncApp (remote )
112- return nil
113- },
114- }
115-
116- return syncAppCmd
117- }
118-
11974func newBoardListCmd () * cobra.Command {
12075 listCmd := & cobra.Command {
12176 Use : "list" ,
0 commit comments