Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

Commit d46d8f0

Browse files
fixing path issue
1 parent 5892a8e commit d46d8f0

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"url": "https://github.com/alexandercbooth/create-nteract-app.git"
88
},
99
"scripts": {
10-
"dev": "node src/index.js",
11-
"test": "jest"
10+
"dev": "CNA_ENV=DEV node src/index.js",
11+
"test": "CNA_ENV=DEV yarn dev snow-leopard && jest"
1212
},
1313
"author": "Alexander C. Booth <[email protected]>",
1414
"license": "MIT",

src/create-nteract-app.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,19 @@ function run(root, appName, version, verbose, originalDirectory, template) {
122122
return install(root, useYarn, allDependencies, verbose)
123123
.then(() => packageName)
124124
.then(packageName => {
125-
const ownPath = path.join(
126-
nodePath.split("\n")[0],
127-
"lib/node_modules",
128-
packageJson.name
129-
);
125+
const templatePath =
126+
process.env.CNA_ENV === "DEV"
127+
? path.join("../src", "template")
128+
: path.join(
129+
path.join(
130+
nodePath.split("\n")[0],
131+
"lib/node_modules",
132+
packageJson.name
133+
),
134+
"src",
135+
"template"
136+
);
130137
const appPath = process.cwd();
131-
const templatePath = path.join(ownPath, "src", "template");
132138
const appDefaultPage = path.join(templatePath, "pages/index.js");
133139

134140
if (fs.existsSync(templatePath)) {

0 commit comments

Comments
 (0)