forked from toolshed/abra
		
	| @ -64,7 +64,7 @@ var AppNewCommand = &cobra.Command{ | ||||
| 	Run: func(cmd *cobra.Command, args []string) { | ||||
| 		recipe := internal.ValidateRecipe(args, cmd.Name()) | ||||
|  | ||||
| 		var version string | ||||
| 		var recipeVersion string | ||||
| 		if !internal.Chaos { | ||||
| 			if err := recipe.EnsureIsClean(); err != nil { | ||||
| 				log.Fatal(err) | ||||
| @ -75,7 +75,6 @@ var AppNewCommand = &cobra.Command{ | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| 			var recipeVersion string | ||||
| 			if len(args) == 2 { | ||||
| 				recipeVersion = args[1] | ||||
| 			} | ||||
| @ -89,10 +88,10 @@ var AppNewCommand = &cobra.Command{ | ||||
| 				if len(recipeVersions) > 0 { | ||||
| 					latest := recipeVersions[len(recipeVersions)-1] | ||||
| 					for tag := range latest { | ||||
| 						version = tag | ||||
| 						recipeVersion = tag | ||||
| 					} | ||||
|  | ||||
| 					if _, err := recipe.EnsureVersion(version); err != nil { | ||||
| 					if _, err := recipe.EnsureVersion(recipeVersion); err != nil { | ||||
| 						log.Fatal(err) | ||||
| 					} | ||||
| 				} else { | ||||
| @ -107,6 +106,14 @@ var AppNewCommand = &cobra.Command{ | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		if internal.Chaos && recipeVersion == "" { | ||||
| 			var err error | ||||
| 			recipeVersion, err = recipe.ChaosVersion() | ||||
| 			if err != nil { | ||||
| 				log.Fatal(err) | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		if err := ensureServerFlag(); err != nil { | ||||
| 			log.Fatal(err) | ||||
| 		} | ||||
| @ -188,7 +195,7 @@ var AppNewCommand = &cobra.Command{ | ||||
| 		headers := []string{"SERVER", "DOMAIN", "RECIPE", "VERSION"} | ||||
| 		table.Headers(headers...) | ||||
|  | ||||
| 		table.Row(newAppServer, appDomain, recipe.Name, version) | ||||
| 		table.Row(newAppServer, appDomain, recipe.Name, recipeVersion) | ||||
|  | ||||
| 		log.Infof("new app '%s' created 🌞", recipe.Name) | ||||
|  | ||||
| @ -221,8 +228,8 @@ var AppNewCommand = &cobra.Command{ | ||||
| 			log.Fatal(err) | ||||
| 		} | ||||
|  | ||||
| 		log.Debugf("choosing %s as version to save to env file", version) | ||||
| 		if err := app.WriteRecipeVersion(version, false); err != nil { | ||||
| 		log.Debugf("choosing %s as version to save to env file", recipeVersion) | ||||
| 		if err := app.WriteRecipeVersion(recipeVersion, false); err != nil { | ||||
| 			log.Fatalf("writing new recipe version in env file: %s", err) | ||||
| 		} | ||||
| 	}, | ||||
|  | ||||
| @ -49,7 +49,7 @@ teardown(){ | ||||
|  | ||||
|   assert_equal $(_get_tag_hash 0.3.0+1.21.0) $(_get_current_hash) | ||||
|  | ||||
|   run grep -q "RECIPE=$TEST_RECIPE:0.3.0+1.21.0" \ | ||||
|   run grep -q "TYPE=$TEST_RECIPE:0.3.0+1.21.0" \ | ||||
|     "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env" | ||||
|   assert_success | ||||
| } | ||||
| @ -65,7 +65,7 @@ teardown(){ | ||||
|   currentHash=$(_get_current_hash) | ||||
|   assert_equal 1e83340e ${currentHash:0:8} | ||||
|  | ||||
|   run grep -q "RECIPE=$TEST_RECIPE:1e83340e" \ | ||||
|   run grep -q "TYPE=$TEST_RECIPE:1e83340e" \ | ||||
|     "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env" | ||||
|   assert_success | ||||
| } | ||||
|  | ||||
| @ -231,8 +231,7 @@ teardown(){ | ||||
|  | ||||
|   run $ABRA app secret rm "$TEST_APP_DOMAIN" test_pass_one --all | ||||
|   assert_failure | ||||
|   assert_output --partial 'cannot use' | ||||
|   assert_output --partial "'--all' together" | ||||
|   assert_output --regexp 'cannot use .* together' | ||||
| } | ||||
|  | ||||
| @test "rm: single secret no match" { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user