From 06fb8f0ffabe6f7c92b7e7844a4f6446f8b208ef Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Thu, 12 Oct 2023 06:10:28 +0200 Subject: [PATCH] vcreate: don't use template names as project descriptions (#19439) --- cmd/tools/vcreate/tests/new_with_model_arg.expect | 1 + cmd/tools/vcreate/vcreate.v | 2 +- cmd/tools/vcreate/vcreate_input_test.v | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/tools/vcreate/tests/new_with_model_arg.expect b/cmd/tools/vcreate/tests/new_with_model_arg.expect index 54997aa894619f..a9630248386706 100755 --- a/cmd/tools/vcreate/tests/new_with_model_arg.expect +++ b/cmd/tools/vcreate/tests/new_with_model_arg.expect @@ -9,6 +9,7 @@ set model [lindex $argv 2] spawn $v_root/v new $project_name $model +expect "Input your project description: " { send "My Awesome V Project.\r" } timeout { exit 1 } expect "Input your project version: (0.0.0) " { send "0.0.1\r" } timeout { exit 1 } expect "Input your project license: (MIT) " { send "\r" } timeout { exit 1 } expect "Initialising ..." {} timeout { exit 1 } diff --git a/cmd/tools/vcreate/vcreate.v b/cmd/tools/vcreate/vcreate.v index 421e5b54138d07..f31c68ab3f0ffa 100644 --- a/cmd/tools/vcreate/vcreate.v +++ b/cmd/tools/vcreate/vcreate.v @@ -81,7 +81,7 @@ fn new_project(args []string) { exit(3) } - c.description = if args.len > 1 { args[1] } else { os.input('Input your project description: ') } + c.description = os.input('Input your project description: ') default_version := '0.0.0' c.version = os.input('Input your project version: (${default_version}) ') diff --git a/cmd/tools/vcreate/vcreate_input_test.v b/cmd/tools/vcreate/vcreate_input_test.v index 43295c6e4034fb..e4309eb740141a 100644 --- a/cmd/tools/vcreate/vcreate_input_test.v +++ b/cmd/tools/vcreate/vcreate_input_test.v @@ -81,7 +81,7 @@ fn test_new_with_model_arg_input() { return } assert mod.name == project_name - assert mod.description == model + assert mod.description == 'My Awesome V Project.' assert mod.version == '0.0.1' assert mod.license == 'MIT' }