File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,5 +8,6 @@ var DaemonCommand *cli.Command = &cli.Command{
88 Subcommands : []* cli.Command {
99 DaemonInstallCommand ,
1010 DaemonUninstallCommand ,
11+ DaemonReinstallCommand ,
1112 },
1213}
Original file line number Diff line number Diff line change 1+ package commands
2+
3+ import (
4+ "github.com/gookit/color"
5+ "github.com/urfave/cli/v2"
6+ )
7+
8+ var DaemonReinstallCommand = & cli.Command {
9+ Name : "reinstall" ,
10+ Usage : "Reinstall the shelltime daemon service (uninstall then install)" ,
11+ Action : commandDaemonReinstall ,
12+ }
13+
14+ func commandDaemonReinstall (c * cli.Context ) error {
15+ color .Yellow .Println ("🔄 Starting daemon service reinstallation..." )
16+
17+ // First, uninstall the existing service
18+ color .Yellow .Println ("🗑 Uninstalling existing daemon service..." )
19+ if err := commandDaemonUninstall (c ); err != nil {
20+ return err
21+ }
22+
23+ // Then, install the service
24+ color .Yellow .Println ("📦 Installing daemon service..." )
25+ if err := commandDaemonInstall (c ); err != nil {
26+ return err
27+ }
28+
29+ color .Green .Println ("✅ Daemon service has been successfully reinstalled!" )
30+ return nil
31+ }
You can’t perform that action at this time.
0 commit comments