MCPcopy Create free account
hub / github.com/cli/cli / Remove

Method Remove

pkg/cmd/extension/manager.go:574–587  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

572}
573
574func (m *Manager) Remove(name string) error {
575 name = normalizeExtension(name)
576 targetDir := filepath.Join(m.installDir(), name)
577 if _, err := os.Lstat(targetDir); os.IsNotExist(err) {
578 return fmt.Errorf("no extension found: %q", targetDir)
579 }
580 if m.dryRunMode {
581 return nil
582 }
583 if err := m.cleanExtensionUpdateDir(name); err != nil {
584 return err
585 }
586 return os.RemoveAll(targetDir)
587}
588
589func (m *Manager) installDir() string {
590 return filepath.Join(m.dataDir(), "extensions")

Callers 1

upgradeExtensionMethod · 0.95

Calls 5

installDirMethod · 0.95
normalizeExtensionFunction · 0.85
JoinMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected