-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding file bypass option to TSP init and copy over Azure template from TypeSpecAzure #2014
Conversation
Changes in this PR will be published to the following url to try(check status of TypeSpec Pull Request Try It pipeline for publish status): Website: https://cadlwebsite.z1.web.core.windows.net/prs/2014/ |
@@ -0,0 +1,69 @@ | |||
import "@typespec/http"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we still waiting on typespec-azure to be made public?
@@ -3,7 +3,7 @@ import { TypeSpecConfigJsonSchema } from "../config/config-schema.js"; | |||
import { TypeSpecRawConfig } from "../config/types.js"; | |||
|
|||
export interface InitTemplateFile { | |||
path: string; | |||
path: string | boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hhm forgot it was an array of this object and not a map. This feels a little wrong to have that this way now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering if we should have instead a new property skip?: boolean
and I think in the future it could be used to conditionally exclude the file from parameters as well
@@ -339,13 +339,20 @@ async function writeFiles(host: CompilerHost, config: ScaffoldingConfig) { | |||
return; | |||
} | |||
for (const file of config.files) { | |||
await writeFile(host, config, file); | |||
if (file.path === false) { | |||
await host.rm(file.destination); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this feels really hacky, it should skip the generation of those not create then delete
Closing this in favor of new PR #2121 |
No description provided.