func runCreate(cmd *cobra.Command, args []string) { if len(args) != 0 { plog.Fatal("No args accepted") } if chrootVersion == "" { plog.Fatal("Missing --sdk-version=VERSION") } plog.Noticef("Downloading SDK version %s", chrootVersion) if err := sdk.DownloadSDK(chrootVersion); err != nil { plog.Fatalf("Download failed: %v", err) } if allowReplace { if err := sdk.Delete(chrootName); err != nil { plog.Fatalf("Replace failed: %v", err) } } if err := sdk.Unpack(chrootVersion, chrootName); err != nil { plog.Fatalf("Create failed: %v", err) } if err := sdk.Setup(chrootName); err != nil { plog.Fatalf("Create failed: %v", err) } }
func runDelete(cmd *cobra.Command, args []string) { if len(args) != 0 { plog.Fatal("No args accepted") } if err := sdk.Delete(chrootName); err != nil { plog.Fatalf("Delete failed: %v", err) } }