diff --git a/arduino/libraries/librariesmanager/install.go b/arduino/libraries/librariesmanager/install.go index 1a7dcfff0ac..ff42a178672 100644 --- a/arduino/libraries/librariesmanager/install.go +++ b/arduino/libraries/librariesmanager/install.go @@ -94,7 +94,7 @@ func (lm *LibrariesManager) Uninstall(lib *libraries.Library) error { } //InstallZipLib installs a Zip library on the specified path. -func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath string) error { +func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath string, overwrite bool) error { libsDir := lm.getUserLibrariesDir() if libsDir == nil { return fmt.Errorf("User directory not set") @@ -104,6 +104,8 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath strin if err != nil { return err } + // Deletes temp dir used to extract archive when finished + defer tmpDir.RemoveAll() file, err := os.Open(archivePath) if err != nil { @@ -126,11 +128,26 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath strin return fmt.Errorf("archive is not valid: multiple files found in zip file top level") } - libraryName := paths[0].Base() + extractionPath := paths[0] + libraryName := extractionPath.Base() installPath := libsDir.Join(libraryName) - // Deletes libraries folder if already installed - if _, ok := lm.Libraries[libraryName]; ok { + if err := libsDir.MkdirAll(); err != nil { + return err + } + defer func() { + // Clean up install dir if installation failed + files, err := installPath.ReadDir() + if err == nil && len(files) == 0 { + installPath.RemoveAll() + } + }() + + // Delete library folder if already installed + if installPath.IsDir() { + if !overwrite { + return fmt.Errorf("library %s already installed", libraryName) + } logrus. WithField("library name", libraryName). WithField("install path", installPath). @@ -144,15 +161,16 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath strin WithField("zip file", archivePath). Trace("Installing library") - if err := tmpDir.Join(libraryName).CopyDirTo(installPath); err != nil { - return fmt.Errorf("copying library: %w", err) + // Copy extracted library in the destination directory + if err := extractionPath.CopyDirTo(installPath); err != nil { + return fmt.Errorf("moving extracted archive to destination dir: %s", err) } return nil } //InstallGitLib installs a library hosted on a git repository on the specified path. -func (lm *LibrariesManager) InstallGitLib(gitURL string) error { +func (lm *LibrariesManager) InstallGitLib(gitURL string, overwrite bool) error { libsDir := lm.getUserLibrariesDir() if libsDir == nil { return fmt.Errorf("User directory not set") @@ -170,6 +188,9 @@ func (lm *LibrariesManager) InstallGitLib(gitURL string) error { // Deletes libraries folder if already installed if _, ok := lm.Libraries[libraryName]; ok { + if !overwrite { + return fmt.Errorf("library %s already installed", libraryName) + } logrus. WithField("library name", libraryName). WithField("install path", installPath). diff --git a/cli/lib/install.go b/cli/lib/install.go index 5518ba27bd0..95274aa115f 100644 --- a/cli/lib/install.go +++ b/cli/lib/install.go @@ -76,11 +76,11 @@ func runInstallCommand(cmd *cobra.Command, args []string) { if installFlags.zipPath { for _, path := range args { - ziplibraryInstallReq := &rpc.ZipLibraryInstallReq{ - Instance: instance, - Path: path, - } - err := lib.ZipLibraryInstall(context.Background(), ziplibraryInstallReq, output.TaskProgress()) + err := lib.ZipLibraryInstall(context.Background(), &rpc.ZipLibraryInstallReq{ + Instance: instance, + Path: path, + Overwrite: true, + }, output.TaskProgress()) if err != nil { feedback.Errorf("Error installing Zip Library: %v", err) os.Exit(errorcodes.ErrGeneric) @@ -99,11 +99,11 @@ func runInstallCommand(cmd *cobra.Command, args []string) { } url = wd.String() } - gitlibraryInstallReq := &rpc.GitLibraryInstallReq{ - Instance: instance, - Url: url, - } - err := lib.GitLibraryInstall(context.Background(), gitlibraryInstallReq, output.TaskProgress()) + err := lib.GitLibraryInstall(context.Background(), &rpc.GitLibraryInstallReq{ + Instance: instance, + Url: url, + Overwrite: true, + }, output.TaskProgress()) if err != nil { feedback.Errorf("Error installing Git Library: %v", err) os.Exit(errorcodes.ErrGeneric) diff --git a/commands/lib/install.go b/commands/lib/install.go index a77ac3e4df6..1a563c95269 100644 --- a/commands/lib/install.go +++ b/commands/lib/install.go @@ -111,8 +111,7 @@ func installLibrary(lm *librariesmanager.LibrariesManager, libRelease *libraries //ZipLibraryInstall FIXMEDOC func ZipLibraryInstall(ctx context.Context, req *rpc.ZipLibraryInstallReq, taskCB commands.TaskProgressCB) error { lm := commands.GetLibraryManager(req.GetInstance().GetId()) - archivePath := req.GetPath() - if err := lm.InstallZipLib(ctx, archivePath); err != nil { + if err := lm.InstallZipLib(ctx, req.Path, req.Overwrite); err != nil { return err } taskCB(&rpc.TaskProgress{Message: "Installed Archived Library", Completed: true}) @@ -122,8 +121,7 @@ func ZipLibraryInstall(ctx context.Context, req *rpc.ZipLibraryInstallReq, taskC //GitLibraryInstall FIXMEDOC func GitLibraryInstall(ctx context.Context, req *rpc.GitLibraryInstallReq, taskCB commands.TaskProgressCB) error { lm := commands.GetLibraryManager(req.GetInstance().GetId()) - url := req.GetUrl() - if err := lm.InstallGitLib(url); err != nil { + if err := lm.InstallGitLib(req.Url, req.Overwrite); err != nil { return err } taskCB(&rpc.TaskProgress{Message: "Installed Library from Git URL", Completed: true}) diff --git a/rpc/commands/lib.pb.go b/rpc/commands/lib.pb.go index 14929ac7c66..e35872843f9 100644 --- a/rpc/commands/lib.pb.go +++ b/rpc/commands/lib.pb.go @@ -1803,6 +1803,8 @@ type ZipLibraryInstallReq struct { Instance *Instance `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` //Path to the archived library Path string `protobuf:"bytes,2,opt,name=Path,proto3" json:"Path,omitempty"` + // Set to true to overwrite an already installed library with the same name. Defaults to false. + Overwrite bool `protobuf:"varint,3,opt,name=overwrite,proto3" json:"overwrite,omitempty"` } func (x *ZipLibraryInstallReq) Reset() { @@ -1851,6 +1853,13 @@ func (x *ZipLibraryInstallReq) GetPath() string { return "" } +func (x *ZipLibraryInstallReq) GetOverwrite() bool { + if x != nil { + return x.Overwrite + } + return false +} + type ZipLibraryInstallResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1908,6 +1917,8 @@ type GitLibraryInstallReq struct { Instance *Instance `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` // URL to the repository containing the library Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + // Set to true to overwrite an already installed library with the same name. Defaults to false. + Overwrite bool `protobuf:"varint,3,opt,name=overwrite,proto3" json:"overwrite,omitempty"` } func (x *GitLibraryInstallReq) Reset() { @@ -1956,6 +1967,13 @@ func (x *GitLibraryInstallReq) GetUrl() string { return "" } +func (x *GitLibraryInstallReq) GetOverwrite() bool { + if x != nil { + return x.Overwrite + } + return false +} + type GitLibraryInstallResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2279,49 +2297,53 @@ var file_commands_lib_proto_rawDesc = []byte{ 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x69, 0x0a, 0x14, 0x5a, - 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, - 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x50, 0x61, 0x74, 0x68, 0x22, 0x63, 0x0a, 0x15, 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x4a, 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x87, 0x01, 0x0a, 0x14, + 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, - 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0c, 0x74, - 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x67, 0x0a, 0x14, 0x47, + 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x22, 0x63, 0x0a, 0x15, 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, + 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4a, + 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, + 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, + 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0c, 0x74, 0x61, + 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x14, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x75, 0x72, 0x6c, 0x22, 0x63, 0x0a, 0x15, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4a, 0x0a, - 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, - 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x54, - 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0c, 0x74, 0x61, 0x73, - 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2a, 0x2e, 0x0a, 0x13, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x0a, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, - 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x01, 0x2a, 0x36, 0x0a, 0x0d, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x79, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x12, 0x0f, 0x0a, 0x0b, 0x66, 0x6c, - 0x61, 0x74, 0x5f, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x72, - 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x10, - 0x01, 0x2a, 0x63, 0x0a, 0x0f, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, - 0x74, 0x69, 0x6e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x10, 0x01, 0x12, - 0x14, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x69, 0x6c, - 0x74, 0x69, 0x6e, 0x10, 0x02, 0x12, 0x1f, 0x0a, 0x1b, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x64, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x69, - 0x6c, 0x74, 0x69, 0x6e, 0x10, 0x03, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, - 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, + 0x74, 0x65, 0x22, 0x63, 0x0a, 0x15, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4a, 0x0a, 0x0d, 0x74, + 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, + 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x54, 0x61, 0x73, + 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0c, 0x74, 0x61, 0x73, 0x6b, 0x50, + 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2a, 0x2e, 0x0a, 0x13, 0x4c, 0x69, 0x62, 0x72, 0x61, + 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, + 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x73, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x01, 0x2a, 0x36, 0x0a, 0x0d, 0x4c, 0x69, 0x62, 0x72, 0x61, + 0x72, 0x79, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x12, 0x0f, 0x0a, 0x0b, 0x66, 0x6c, 0x61, 0x74, + 0x5f, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x72, 0x65, 0x63, + 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x10, 0x01, 0x2a, + 0x63, 0x0a, 0x0f, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, + 0x6e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x10, 0x01, 0x12, 0x14, 0x0a, + 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, + 0x6e, 0x10, 0x02, 0x12, 0x1f, 0x0a, 0x1b, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x64, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x74, + 0x69, 0x6e, 0x10, 0x03, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, + 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/rpc/commands/lib.proto b/rpc/commands/lib.proto index 93c801efb6e..e5d5c54eaac 100644 --- a/rpc/commands/lib.proto +++ b/rpc/commands/lib.proto @@ -302,6 +302,8 @@ message ZipLibraryInstallReq { Instance instance = 1; //Path to the archived library string Path = 2; + // Set to true to overwrite an already installed library with the same name. Defaults to false. + bool overwrite = 3; } message ZipLibraryInstallResp { @@ -314,6 +316,8 @@ message GitLibraryInstallReq { Instance instance = 1; // URL to the repository containing the library string url = 2; + // Set to true to overwrite an already installed library with the same name. Defaults to false. + bool overwrite = 3; } message GitLibraryInstallResp {