Skip to content

Commit

Permalink
use globalName to differentiate extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
jodeleeuw committed Aug 9, 2023
1 parent b2dcfe1 commit b615984
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion templates/cli/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ inquirer
answers.name.charAt(0).toUpperCase() +
answers.name.slice(1).replace(/-([a-z])/g, (g) => g[1].toUpperCase());

const globalName =
"jsPsych" + (answers.type === "extension" ? "Extension" : "") + camelCaseName;

const destPath = `${answers.type}-${answers.name}`;

gulp
Expand All @@ -84,7 +87,7 @@ inquirer
)
)
.pipe(replace("{description}", answers.description))
.pipe(replace("_globalName_", "jsPsych" + camelCaseName))
.pipe(replace("_globalName_", globalName))
.pipe(replace("PluginNamePlugin", `${camelCaseName}Plugin`))
.pipe(replace("ExtensionNameExtension", `${camelCaseName}Extension`))
.pipe(gulp.dest(`${repoRoot}/packages/${destPath}`));
Expand Down

0 comments on commit b615984

Please sign in to comment.