From afbd4e06e68cbcf5cc499931fbb8383a31260189 Mon Sep 17 00:00:00 2001 From: Yann Renaudin Date: Thu, 27 Sep 2018 23:49:47 -0400 Subject: [PATCH] fix: fix wrong working directory when fetching template package --- packages/cli/createTsLib.js | 4 ++-- packages/cli/package-lock.json | 6 ++++++ packages/cli/package.json | 7 ++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/cli/createTsLib.js b/packages/cli/createTsLib.js index 760f87b..6e8d57c 100644 --- a/packages/cli/createTsLib.js +++ b/packages/cli/createTsLib.js @@ -80,9 +80,9 @@ function createApp(name) { async function run(root, appName, originalDirectory) { function installTemplate(templateName) { try { - console.log('loading template', templateName); + console.log(`loading ${templateName} template in ${path.resolve(__dirname)}`); const res = require('child_process') - .execSync(`npm install ${templateName}`) + .execSync(`npm install ${templateName}`, { cwd: path.resolve(__dirname) }) .toString() .trim(); console.log(`${templateName} loaded successfully`); diff --git a/packages/cli/package-lock.json b/packages/cli/package-lock.json index c9e7077..628fc03 100644 --- a/packages/cli/package-lock.json +++ b/packages/cli/package-lock.json @@ -32,6 +32,12 @@ "glob-to-regexp": "^0.3.0" } }, + "@nobrainr/typescript_universal-webpack-karma_jasmine": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@nobrainr/typescript_universal-webpack-karma_jasmine/-/typescript_universal-webpack-karma_jasmine-1.0.0.tgz", + "integrity": "sha512-yt9IFFFsnYn0KwZxqKehMPyN/RpyF8tP8U7uJqj0yFrqox5Pxedv9h+aTWNzIGVGNbaihC6STzQokEzQQeNIfQ==", + "dev": true + }, "@nodelib/fs.stat": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.1.tgz", diff --git a/packages/cli/package.json b/packages/cli/package.json index cdd6189..739a8c3 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -9,10 +9,7 @@ "test": "echo \"Error: no test specified\" && exit 1", "postinstall": "opencollective-postinstall" }, - "repository": { - "type": "git", - "url": "git+https://github.com/emyann/typescript-webpack-starter.git" - }, + "repository": "nobrainr/typescript-webpack-starter", "keywords": [ "webpack", "javascript", @@ -53,7 +50,7 @@ "validate-npm-package-name": "^3.0.0" }, "devDependencies": { - "@nobrainr/typescript_universal-webpack-karma_jasmine": "1.0.0", + "@nobrainr/typescript_universal-webpack-karma_jasmine": "^1.0.0", "marked": "^0.4.0", "semantic-release": "^15.9.9" },