blob: d8bf5c14c2744f4a0766507e160f914e252ec40b [file] [log] [blame]
package actions
import (
"context"
"strings"
"cos.googlesource.com/cos/tools.git/src/pkg/dkms"
"github.com/spf13/cobra"
)
var unbuildCmd = &cobra.Command{
Use: "unbuild",
Short: "Uninstall a module and remove it from the build tree",
Long: strings.TrimSpace(`
Unbuild removes a module from the DKMS build tree and uninstalls it.
This removes the compiled modules from the build directory, then calls
the CLEAN command for the package from the package's build directory.
If a --gcs-bucket is passed, this will unbuild the package in the bucket as
well.
`),
Args: ParseArgs,
RunE: func(cmd *cobra.Command, args []string) error {
if RootGCSBucket == nil {
return dkms.Unbuild(RootPackage)
} else {
return dkms.CachedUnbuild(context.Background(), RootPackage, RootGCSBucket)
}
},
}
func init() {
rootCmd.AddCommand(unbuildCmd)
}