diff --git a/package-lock.json b/package-lock.json index e4f22e2..bfa0179 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,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", diff --git a/package.json b/package.json index 1398799..573d95e 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -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", diff --git a/src/commands/init/init.js b/src/commands/init/init.js index 379d0cc..eabedcf 100644 --- a/src/commands/init/init.js +++ b/src/commands/init/init.js @@ -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)) {