Moved the plugin directory
All checks were successful
Release Build / build (push) Successful in 1m53s

This commit is contained in:
Leon Mika 2026-09-09 21:08:46 +10:00
parent add62fbfa0
commit 9751be125e
5 changed files with 47 additions and 12 deletions

View file

@ -173,13 +173,24 @@ func (p *PluginFilters) Errors() []error {
return p.errors
}
// pluginDir returns the plugin directory: $HOME/.config/dequoter/plugins
// pluginDir returns the plugin directory under macOS Application Support.
func pluginDir() (string, error) {
home, err := os.UserHomeDir()
if err != nil {
return "", err
}
return filepath.Join(home, ".config", "dequoter", "plugins"), nil
return filepath.Join(home, "Library", "Application Support", "dev.lmika.dequoter", "Plugins"), nil
}
func ensurePluginDir() (string, error) {
dir, err := pluginDir()
if err != nil {
return "", err
}
if err := os.MkdirAll(dir, 0755); err != nil {
return "", fmt.Errorf("create plugin directory: %w", err)
}
return dir, nil
}
var nonSlugChars = regexp.MustCompile(`[^a-z0-9]+`)