test: ensure .env version written

This commit is contained in:
2025-01-08 14:19:01 +01:00
committed by decentral1se
parent c70b6e72a7
commit 993172d31b
2 changed files with 25 additions and 1 deletions

View File

@ -236,7 +236,16 @@ var AppNewCommand = &cobra.Command{
log.Fatal(err)
}
if err := app.WriteRecipeVersion(recipeVersion, false); err != nil {
if err := app.Recipe.IsDirty(); err != nil {
log.Fatal(err)
}
toWriteVersion := recipeVersion
if internal.Chaos || app.Recipe.Dirty {
toWriteVersion = chaosVersion
}
if err := app.WriteRecipeVersion(toWriteVersion, false); err != nil {
log.Fatalf("writing recipe version failed: %s", err)
}
},