Skip to content

Commit 0e5a975

Browse files
committed
update create with improved file paths
1 parent d2c99f9 commit 0e5a975

File tree

21 files changed

+29
-221
lines changed

21 files changed

+29
-221
lines changed

lib/create/write-demo.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var path = require('path');
44
var file_1 = require('../tools/file');
55
function createFile(pathToFile) {
66
if (!file_1.fileExists(pathToFile)) {
7-
var inputPath = path.join(__dirname, 'setup', pathToFile);
7+
var inputPath = path.join(__dirname, '..', '..', 'setup', pathToFile);
88
var test = fs.readFileSync(inputPath, 'utf8');
99
fs.writeFileSync(pathToFile, test, 'utf8');
1010
}
@@ -16,17 +16,19 @@ function createFolder(pathToFolder) {
1616
}
1717
function createTutorialMd() {
1818
createFolder('tutorial');
19-
createFile('tutorial/tutorial.md');
20-
createFolder('tutorial/1');
21-
createFolder('tutorial/1/01');
22-
createFile('tutorial/1/01/page-one.md');
23-
createFolder('tutorial/1/02');
24-
createFile('tutorial/1/02/page-two.md');
19+
createFile(path.join('tutorial', 'tutorial.md'));
20+
createFolder(path.join('tutorial', '1'));
21+
createFolder(path.join('tutorial', '1', '01'));
22+
createFile(path.join('tutorial', '1', '01', 'page-one.md'));
23+
createFolder(path.join('tutorial', '1', '02'));
24+
createFile(path.join('tutorial', '1', '02', 'page-two.md'));
25+
createFolder(path.join('tutorial', 'common'));
26+
createFile(path.join('tutorial', 'common', 'loadJS.js'));
2527
}
2628
exports.createTutorialMd = createTutorialMd;
2729
function createPackageJson(name) {
2830
if (!file_1.fileExists('package.json')) {
29-
var inputPath = path.join(__dirname, './setup/package.json');
31+
var inputPath = path.join(__dirname, '..', '..', 'setup', 'package.json');
3032
var packageJson = JSON.parse(fs.readFileSync(inputPath, 'utf8'));
3133
packageJson.name = 'coderoad-' + name;
3234
var packageJsonString = JSON.stringify(packageJson, null, 2);
@@ -35,9 +37,9 @@ function createPackageJson(name) {
3537
}
3638
exports.createPackageJson = createPackageJson;
3739
function createTestFiles() {
38-
createFile('tutorial/1/01/01.spec.js');
39-
createFile('tutorial/1/01/02.spec.js');
40-
createFile('tutorial/1/02/01.spec.js');
41-
createFile('tutorial/1/02/02.spec.js');
40+
createFile(path.join('tutorial', '1', '01', '01.spec.js'));
41+
createFile(path.join('tutorial', '1', '01', '02.spec.js'));
42+
createFile(path.join('tutorial', '1', '02', '01.spec.js'));
43+
createFile(path.join('tutorial', '1', '02', '02.spec.js'));
4244
}
4345
exports.createTestFiles = createTestFiles;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "coderoad-cli",
3-
"version": "0.3.21",
3+
"version": "0.3.22",
44
"description": "Command line interface for CodeRoad. Build project files.",
55
"keywords": [
66
"coderoad"
File renamed without changes.

0 commit comments

Comments
 (0)