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

Method cleanExtensionUpdateDir

pkg/cmd/extension/manager.go:878–883  ·  view source on GitHub ↗

cleanExtensionUpdateDir deletes the extension-specific directory containing metadata used in checking for updates. Because extension names are not unique across GitHub organizations and users, we feel its important to clean up this metadata before installing or removing an extension with the same na

(name string)

Source from the content-addressed store, hash-verified

876// This could change over time as other functionality is added to extensions, which we cannot predict within cli/cli#9934,
877// such as extension manifest and lock files within cli/cli#6118.
878func (m *Manager) cleanExtensionUpdateDir(name string) error {
879 if err := os.RemoveAll(m.UpdateDir(name)); err != nil {
880 return fmt.Errorf("failed to remove previous extension update state: %w", err)
881 }
882 return nil
883}
884
885// normalizeExtension makes sure that the provided extension name is prefixed with "gh-".
886func normalizeExtension(name string) string {

Callers 4

InstallLocalMethod · 0.95
installBinMethod · 0.95
installGitMethod · 0.95
RemoveMethod · 0.95

Calls 2

UpdateDirMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected