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

Method Remove

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

Source from the content-addressed store, hash-verified

577}
578
579func (m *Manager) Remove(name string) error {
580 name = normalizeExtension(name)
581 targetDir := filepath.Join(m.installDir(), name)
582 if _, err := os.Lstat(targetDir); os.IsNotExist(err) {
583 return fmt.Errorf("no extension found: %q", targetDir)
584 }
585 if m.dryRunMode {
586 return nil
587 }
588 if err := m.cleanExtensionUpdateDir(name); err != nil {
589 return err
590 }
591 return os.RemoveAll(targetDir)
592}
593
594func (m *Manager) installDir() string {
595 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