Skip to content

feat: generate changes only#1

Open
jerryafr wants to merge 3 commits into
mainfrom
feat/diff
Open

feat: generate changes only#1
jerryafr wants to merge 3 commits into
mainfrom
feat/diff

Conversation

@jerryafr
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread src/codegen.ts
Comment on lines +317 to +338
try {
await fs.access(
path.join(
generatedDir,
version,
uncapitalize(palletName),
`${uncapitalize(eventName)}.ts`,
),
);
} catch (err) {
// File does not exist in this version, continue until we find the first match
continue;
}
const lastContent = await fs.readFile(
path.join(
generatedDir,
version,
uncapitalize(palletName),
`${uncapitalize(eventName)}.ts`,
),
'utf8',
);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
try {
await fs.access(
path.join(
generatedDir,
version,
uncapitalize(palletName),
`${uncapitalize(eventName)}.ts`,
),
);
} catch (err) {
// File does not exist in this version, continue until we find the first match
continue;
}
const lastContent = await fs.readFile(
path.join(
generatedDir,
version,
uncapitalize(palletName),
`${uncapitalize(eventName)}.ts`,
),
'utf8',
);
const lastContent = await fs.readFile(
path.join(
generatedDir,
version,
uncapitalize(palletName),
`${uncapitalize(eventName)}.ts`,
),
'utf8',
).catch(() => null);
// File does not exist in this version, continue until we find the first match
if (lastContent === null) continue;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants