From 30d6f8cecd64806ec92d8bfce9cb6c41184eb8a2 Mon Sep 17 00:00:00 2001 From: Dru Jensen Date: Mon, 22 Apr 2024 19:00:32 -0700 Subject: [PATCH] fix: powershell --- src/lib/config.js | 2 +- src/lib/renderer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/config.js b/src/lib/config.js index 1a3b006..53c3d57 100644 --- a/src/lib/config.js +++ b/src/lib/config.js @@ -99,7 +99,7 @@ function validate(schema, config, key = ROOT_KEY) { } function getConfig(configPath = 'cookiecutter.config.js') { - const pwd = process.env.PWD; + const pwd = process.cwd(); const config = require(path.join(pwd, configPath)); return validateConfig(config); } diff --git a/src/lib/renderer.js b/src/lib/renderer.js index ca1326c..7dd561d 100644 --- a/src/lib/renderer.js +++ b/src/lib/renderer.js @@ -15,7 +15,7 @@ function replaceFields(string, fields) { function renderFiles({templateName, fields}, configLocation) { const config = getTemplateConfig(templateName, configLocation); - const pwd = process.env.PWD; + const pwd = process.cwd(); const destinationDirectory = path.resolve(pwd, config.outputPath); const templateDirectory = path.resolve(pwd, config.templatePath); const isFolderTemplate = isDirectory(templateDirectory);