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)
| 870 | // This could change over time as other functionality is added to extensions, which we cannot predict within cli/cli#9934, |
| 871 | // such as extension manifest and lock files within cli/cli#6118. |
| 872 | func (m *Manager) cleanExtensionUpdateDir(name string) error { |
| 873 | if err := os.RemoveAll(m.UpdateDir(name)); err != nil { |
| 874 | return fmt.Errorf("failed to remove previous extension update state: %w", err) |
| 875 | } |
| 876 | return nil |
| 877 | } |
| 878 | |
| 879 | // normalizeExtension makes sure that the provided extension name is prefixed with "gh-". |
| 880 | func normalizeExtension(name string) string { |
no test coverage detected