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

Method Remove

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

Source from the content-addressed store, hash-verified

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