Skip to content

Commit a3dad97

Browse files
committed
include setup files
1 parent 52d04c4 commit a3dad97

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

lib/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var search_1 = require('./search/search');
99
var tutorials_1 = require('./tutorials/tutorials');
1010
var publish_1 = require('./publish/publish');
1111
program
12-
.version('0.3.24')
12+
.version('0.3.26')
1313
.usage('[options] <keywords>')
1414
.option('-b, --build [path/to/tutorial.md]', 'tutorial markdown file', /^.+\.md$/i)
1515
.option('-c, --create [name]', 'tutorial name')

lib/create/write-demo.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function createTutorialMd() {
2828
exports.createTutorialMd = createTutorialMd;
2929
function createPackageJson(name) {
3030
if (!file_1.fileExists('package.json')) {
31+
console.log(__dirname);
3132
var inputPath = path.join(__dirname, '..', '..', 'setup', 'package.json');
3233
var packageJson = JSON.parse(fs.readFileSync(inputPath, 'utf8'));
3334
packageJson.name = 'coderoad-' + name;

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "coderoad-cli",
3-
"version": "0.3.25",
3+
"version": "0.3.26",
44
"description": "Command line interface for CodeRoad. Build project files.",
55
"keywords": [
66
"coderoad"
77
],
88
"directories": {
9-
"test": "tests"
9+
"test": "test"
1010
},
1111
"scripts": {
1212
"test": "echo \"Error: no test specified\" && exit 1"
@@ -18,6 +18,7 @@
1818
"coderoad": "lib/cli.js"
1919
},
2020
"files": [
21+
"setup",
2122
"lib",
2223
"package.json",
2324
"*.md"

src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import tutorials from './tutorials/tutorials';
99
import publish from './publish/publish';
1010

1111
program
12-
.version('0.3.24')
12+
.version('0.3.26')
1313
.usage('[options] <keywords>')
1414
.option('-b, --build [path/to/tutorial.md]', 'tutorial markdown file', /^.+\.md$/i)
1515
.option('-c, --create [name]', 'tutorial name')

src/create/write-demo.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {fileExists} from '../tools/file';
44

55
function createFile(pathToFile: string): void {
66
if (!fileExists(pathToFile)) {
7-
let inputPath = path.join(__dirname, '..', '..', 'setup', pathToFile);
7+
let inputPath: string = path.join(__dirname, '..', '..', 'setup', pathToFile);
88
let test = fs.readFileSync(inputPath, 'utf8');
99
fs.writeFileSync(pathToFile, test, 'utf8');
1010
}
@@ -30,10 +30,11 @@ export function createTutorialMd(): void {
3030

3131
export function createPackageJson(name: string): void {
3232
if (!fileExists('package.json')) {
33-
let inputPath = path.join(__dirname, '..', '..', 'setup', 'package.json');
34-
let packageJson = JSON.parse(fs.readFileSync(inputPath, 'utf8'));
33+
console.log(__dirname);
34+
let inputPath: string = path.join(__dirname, '..', '..', 'setup', 'package.json');
35+
let packageJson: PackageJson = JSON.parse(fs.readFileSync(inputPath, 'utf8'));
3536
packageJson.name = 'coderoad-' + name;
36-
let packageJsonString = JSON.stringify(packageJson, null, 2);
37+
let packageJsonString: string = JSON.stringify(packageJson, null, 2);
3738
fs.writeFileSync('package.json', packageJsonString, 'utf8');
3839
}
3940
}

0 commit comments

Comments
 (0)