feat(watcher): add macOS autostart support via launchd

This commit is contained in:
Mathis Maquenne
2025-06-23 20:03:56 -04:00
parent 31d8a3b04f
commit a619b37922
3 changed files with 97 additions and 1 deletions
+12 -1
View File
@@ -1,7 +1,11 @@
package cmd
import (
"fmt"
"os"
"github.com/mathismqn/godeez/internal/config"
"github.com/mathismqn/godeez/internal/watcher"
"github.com/spf13/cobra"
)
@@ -17,8 +21,15 @@ var RootCmd = &cobra.Command{
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
var err error
appConfig, err = config.New(cfgPath)
if err != nil {
return err
}
return err
if err := watcher.EnsureAutostart(); err != nil {
fmt.Fprintf(os.Stderr, "Warning: failed to install autostart for watcher: %v\n", err)
}
return nil
},
}