MCPcopy
hub / github.com/puma/puma-dev / Uninstall

Function Uninstall

dev/setup_darwin.go:208–234  ·  view source on GitHub ↗
(launchAgentDirPath string, domains []string)

Source from the content-addressed store, hash-verified

206}
207
208func Uninstall(launchAgentDirPath string, domains []string) func() {
209 // Default: ~/Library/LaunchAgents/
210 plistDir := homedir.MustExpand(launchAgentDirPath)
211 plist := filepath.Join(plistDir, "io.puma.dev.plist")
212
213 // Remove puma-dev daemon
214 exec.Command("launchctl", "unload", plist).Run()
215 os.Remove(plist)
216 fmt.Printf("* Removed puma-dev from automatically running\n")
217
218 for _, d := range domains {
219 os.Remove(filepath.Join("/etc/resolver", d))
220 fmt.Printf("* Removed domain '%s'\n", d)
221 }
222
223 // Remove all `Puma-dev CA` certificate entries from macOS keychain
224 if err := DeleteAllPumaDevCAFromDefaultKeychain(); err != nil {
225 fmt.Printf("! Unable to remove all Puma-dev CA certs from macOS keychain: %s\n", err)
226 return func() {}
227 } else {
228 fmt.Printf("* Removed all Puma-dev CA certs from macOS keychain.\n")
229
230 return func() {
231 os.RemoveAll(homedir.MustExpand(SupportDir))
232 }
233 }
234}

Callers 2

mainFunction · 0.92

Calls 2

MustExpandFunction · 0.92

Tested by 1