Skip to content

Commit

Permalink
fixing failing cookiecutter rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacobsson committed Aug 17, 2023
1 parent 6339388 commit 2298fdb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "samp-cli",
"version": "1.0.41",
"version": "1.0.42",
"description": "CLI tool for extended productivity with AWS Serverless Application Model (SAM)",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -62,7 +62,7 @@
"lodash": "^4.17.21",
"mqtt": "^4.3.7",
"nodemon": "^2.0.22",
"nunjucks": "^3.2.3",
"nunjucks": "^3.2.4",
"open": "^7.4.2",
"openai": "^3.3.0",
"rimraf": "^5.0.1",
Expand Down
12 changes: 8 additions & 4 deletions src/commands/init/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,18 @@ async function run(cmd) {
if (typeof cookiecutter[key] !== "string") {
continue;
}
cookiecutter[key] = await inputUtil.text(
capitalizeFirstLetter(key.replaceAll("_", " ")),
nunjucks.renderString(cookiecutter[key], cookiecutter) ||

try {
cookiecutter[key] = await inputUtil.text(
capitalizeFirstLetter(key.replaceAll("_", " ")),
nunjucks.renderString(cookiecutter[key], cookiecutter) ||
nunjucks.renderString(
cookiecutter[key].replace("cookiecutter_", ""),
cookiecutter
)
);
);
} catch (e) {
}
}

for (const key of Object.keys(cookiecutter)) {
Expand Down

0 comments on commit 2298fdb

Please sign in to comment.