File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Release
22
3+ ## 2024-05-20 - 0.7.1
4+
5+ - Added ` --no-prompt ` flag to skip the output directory confirmation prompt.
6+
37## 2024-04-18 - 0.7.0
48
59- Remove ` resources.json ` after converting resource manager specifications.
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ Convert an existing swagger specification to a TypeSpec project. This command sh
5656 an existing emitter-package.json [boolean]
5757 -h, --help Show help [boolean]
5858 --local-spec-repo Path to local repository with the TypeSpec project [string]
59+ --no-prompt Skip prompting for output directory confirmation [boolean]
5960 --save-inputs Don't clean up the temp directory after generation [boolean]
6061 --skip-sync-and-generate Skip sync and generate during project init [boolean]
6162 --swagger-readme Path or url to swagger readme file [string]
Original file line number Diff line number Diff line change 11{
22 "name" : " @azure-tools/typespec-client-generator-cli" ,
3- "version" : " 0.7.0 " ,
3+ "version" : " 0.7.1 " ,
44 "description" : " A tool to generate Azure SDKs from TypeSpec" ,
55 "main" : " dist/index.js" ,
66 "homepage" : " https://github.com/Azure/azure-sdk-tools/tree/main/tools/tsp-client#readme" ,
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ Options:
7979 an existing emitter-package.json [boolean]
8080 -h, --help Show help [boolean]
8181 --local-spec-repo Path to local repository with the TypeSpec project [string]
82+ --no-prompt Skip prompting for output directory confirmation [boolean]
8283 --save-inputs Don't clean up the temp directory after generation [boolean]
8384 --skip-sync-and-generate Skip sync and generate during project init [boolean]
8485 --swagger-readme Path or url to swagger readme file [string]
Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ export async function getOptions(): Promise<Options> {
6161 [ "local-spec-repo" ] : {
6262 type : "string" ,
6363 } ,
64+ [ "no-prompt" ] : {
65+ type : "boolean" ,
66+ } ,
6467 [ "save-inputs" ] : {
6568 type : "boolean" ,
6669 } ,
@@ -72,7 +75,7 @@ export async function getOptions(): Promise<Options> {
7275 } ,
7376 arm : {
7477 type : "boolean" ,
75- }
78+ } ,
7679 } ,
7780 } ) ;
7881 if ( values . help ) {
@@ -142,8 +145,12 @@ export async function getOptions(): Promise<Options> {
142145 }
143146 outputDir = resolvePath ( process . cwd ( ) , outputDir ) ;
144147
148+ let noPrompt = false ;
149+ if ( values [ "no-prompt" ] ) {
150+ noPrompt = true ;
151+ }
145152 let useOutputDir ;
146- if ( process . stdin . isTTY ) {
153+ if ( process . stdin . isTTY && ! noPrompt ) {
147154 // Ask user is this is the correct output directory
148155 const prompt = PromptSync ( ) ;
149156 useOutputDir = prompt ( "Use output directory '" + outputDir + "'? (y/n) " , "y" ) ;
You can’t perform that action at this time.
0 commit comments