Update dagger new cmd to specify architecture when creating an environment

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau
2021-10-22 21:54:18 +02:00
parent caa03a37cc
commit e9de597654
3 changed files with 12 additions and 5 deletions

View File

@@ -34,7 +34,7 @@ var newCmd = &cobra.Command{
st, err := project.Create(ctx, name, state.Plan{
Package: viper.GetString("package"),
})
}, viper.GetString("architecture"))
if err != nil {
lg.Fatal().Err(err).Msg("failed to create environment")
@@ -46,6 +46,7 @@ var newCmd = &cobra.Command{
func init() {
newCmd.Flags().StringP("package", "p", "", "references the name of the Cue package within the module to use as a plan. Default: defer to cue loader")
newCmd.Flags().StringP("architecture", "a", "", "architecture of the running pipeline. Default: host architecture")
if err := viper.BindPFlags(newCmd.Flags()); err != nil {
panic(err)
}