blob: c6c61a89e66aa61bf3679e7f3cb20674595de4dd [file] [log] [blame]
package actions
import (
"context"
"strings"
"cos.googlesource.com/cos/tools.git/src/pkg/dkms"
"github.com/spf13/cobra"
)
var removeCmd = &cobra.Command{
Use: "remove",
Short: "Uninstalls and unbuilds a model, then removes it from the source tree",
Long: strings.TrimSpace(`
Removes a package from the DKMS source tree.
This will also unbuild and uninstall the package, if applicable. See the
unbuild and uninstall commands for more details.
If a --gcs-bucket is passed, this will remove the package from the bucket as
well.
`),
Args: ParseArgs,
RunE: func(cmd *cobra.Command, args []string) error {
if RootGCSBucket == nil {
return dkms.Remove(RootPackage)
} else {
return dkms.CachedRemove(context.Background(), RootPackage, RootGCSBucket)
}
},
}
func init() {
rootCmd.AddCommand(removeCmd)
}