Skip to content
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

Fix capitalization for generated fs.readdirSync #11478

Merged
merged 1 commit into from Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: programgen/nodejs
description: Fix capitalization when generating `fs.readdirSync`.
2 changes: 1 addition & 1 deletion pkg/codegen/nodejs/gen_program_expressions.go
Expand Up @@ -429,7 +429,7 @@ func (g *generator) GenFunctionCallExpression(w io.Writer, expr *model.FunctionC
case "readFile":
g.Fgenf(w, "fs.readFileSync(%v)", expr.Args[0])
case "readDir":
g.Fgenf(w, "fs.readDirSync(%v)", expr.Args[0])
g.Fgenf(w, "fs.readdirSync(%v)", expr.Args[0])
case "secret":
g.Fgenf(w, "pulumi.secret(%v)", expr.Args[0])
case "split":
Expand Down
5 changes: 2 additions & 3 deletions pkg/codegen/testing/test/program_driver.go
Expand Up @@ -66,13 +66,12 @@ var PulumiPulumiProgramTests = []ProgramTest{
{
Directory: "aws-s3-folder",
Description: "AWS S3 Folder",
ExpectNYIDiags: allProgLanguages.Except("go"),
SkipCompile: allProgLanguages.Except("dotnet"),
ExpectNYIDiags: codegen.NewStringSet("dotnet", "python"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ExpectNYI was only for go but now also for dotnetand python? The equivalent in dotnet is a simple function Directory.EnumerateFiles from the System.IO namespace

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nevermind, I read that incorrectly 😓 my bad

SkipCompile: codegen.NewStringSet("go", "python"),
// Blocked on python: TODO[pulumi/pulumi#8062]: Re-enable this test.
// Blocked on go:
// TODO[pulumi/pulumi#8064]
// TODO[pulumi/pulumi#8065]
// Blocked on nodejs: TODO[pulumi/pulumi#8063]
},
{
Directory: "aws-eks",
Expand Down
Expand Up @@ -9,7 +9,7 @@ const siteBucket = new aws.s3.Bucket("siteBucket", {website: {
const siteDir = "www";
// For each file in the directory, create an S3 object stored in `siteBucket`
const files: aws.s3.BucketObject[] = [];
for (const range of fs.readDirSync(siteDir).map((v, k) => ({key: k, value: v}))) {
for (const range of fs.readdirSync(siteDir).map((v, k) => ({key: k, value: v}))) {
files.push(new aws.s3.BucketObject(`files-${range.key}`, {
bucket: siteBucket.id,
key: range.value,
Expand Down