From 1a3196894009cbfcbd3e8ef72debf0606995b1c0 Mon Sep 17 00:00:00 2001 From: Sid Date: Sun, 6 May 2018 02:16:41 +0200 Subject: [PATCH] fix: change name in bsconfig.json to package name --- src/scripts/init.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/scripts/init.js b/src/scripts/init.js index dc4bb3a..273fade 100644 --- a/src/scripts/init.js +++ b/src/scripts/init.js @@ -113,6 +113,16 @@ https://github.com/npm/npm/issues/16991 // Copy the files for the user await fse.copy(path.join(ownPath, 'template'), appPath); + + // Change the name in bsconfig.json to package's name + const appBsConfigPath: string = path.join(appPath, 'bsconfig.json'); + const appBsConfig = JSON.parse(await fse.readFile(appBsConfigPath)); + + appBsConfig.name = appName; + + // Write the new appBsConfig + await fse.writeFile(appBsConfigPath, JSON.stringify(appBsConfig, null, 2)); + // Rename gitignore after the fact to prevent npm from renaming it to .npmignore try {