Skip to content

Commit

Permalink
Cleanup use of scaffold context
Browse files Browse the repository at this point in the history
  • Loading branch information
tkcranny committed Oct 10, 2024
1 parent 0f9f04f commit 9c4bc34
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions packages/cli/src/oclif/commands/scaffold.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class ScaffoldCommand extends BaseCommand {
);
}

const templateContext = context.templateContext;

const actionKey = context.templateContext.KEY;

const preventOverwrite = !context.force;
Expand All @@ -63,7 +61,7 @@ class ScaffoldCommand extends BaseCommand {
);
await writeTemplateFile(
context.actionType,
templateContext,
context.templateContext,
getFullActionFilePathWithExtension(context.newActionDir, actionKey),
preventOverwrite
);
Expand All @@ -77,7 +75,7 @@ class ScaffoldCommand extends BaseCommand {
);
await writeTemplateFile(
'test',
templateContext,
context.templateContext,
getFullActionFilePathWithExtension(
context.newTestActionDir,
actionKey,
Expand All @@ -94,17 +92,17 @@ class ScaffoldCommand extends BaseCommand {

const originalContents = await updateEntryFile(
entryFilePath,
templateContext.VARIABLE,
context.templateContext.VARIABLE,
getFullActionFilePath(context.newActionDir, actionKey),
context.actionType,
templateContext.KEY
context.templateContext.KEY
);

if (isValidAppInstall().valid) {
const success = isValidEntryFileUpdate(
entryFilePath,
context.actionType,
templateContext.KEY
context.templateContext.KEY
);

this.stopSpinner({ success });
Expand All @@ -122,13 +120,13 @@ class ScaffoldCommand extends BaseCommand {
[
`\nPlease add the following lines to ${entryFilePath}:`,
` * \`const ${
templateContext.VARIABLE
context.templateContext.VARIABLE
} = require('./${getRelativeRequirePath(
entryFilePath,
getFullActionFilePath(context.newActionDir, actionKey)
)}');\` at the top-level`,
` * \`[${templateContext.VARIABLE}.key]: ${
templateContext.VARIABLE
` * \`[${context.templateContext.VARIABLE}.key]: ${
context.templateContext.VARIABLE
}\` in the "${plural(
context.actionType
)}" object in your exported integration definition.`,
Expand Down

0 comments on commit 9c4bc34

Please sign in to comment.