mirror of
https://github.com/daveberrys/guh.git
synced 2026-11-29 00:26:46 +08:00
24 lines
415 B
Go
24 lines
415 B
Go
package cli
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var removeCmd = &cobra.Command{
|
|
Use: "remove",
|
|
Short: "Deletes the Guh binary",
|
|
Args: cobra.NoArgs,
|
|
RunE: func(cobraCmd *cobra.Command, args []string) error {
|
|
fmt.Println("Deleting Guh binary...")
|
|
fmt.Println("Goodbye, world!")
|
|
|
|
sysExec, _ := os.Executable()
|
|
err := os.Remove(sysExec)
|
|
if err != nil { return err }
|
|
|
|
return nil
|
|
},
|
|
} |