Skip to content

Commit

Permalink
ff
Browse files Browse the repository at this point in the history
  • Loading branch information
atian25 committed Mar 28, 2018
1 parent e701ea1 commit 937ed0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ class Command extends BaseCommand {
// read `egg.typescript` from package.json
const baseDir = argv._[0] || argv.baseDir || cwd;
const pkgFile = path.join(baseDir, 'package.json');
console.log('############', pkgFile);
if (fs.existsSync(pkgFile)) {
const pkgInfo = require(pkgFile);
const pkgInfo = JSON.parse(fs.readFileSync(pkgFile, 'utf-8'));
console.log('############', pkgInfo);
if (pkgInfo && pkgInfo.egg && pkgInfo.egg.typescript) {
argv.typescript = true;
}
Expand Down
4 changes: 2 additions & 2 deletions test/ts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('test/ts.test.js', () => {
return;
}
return coffee.fork(eggBin, [ 'dev' ], { cwd })
// .debug()
.debug()
.expect('stdout', /hi, egg, 12345/)
.expect('stdout', /started/)
.expect('code', 0)
Expand All @@ -84,7 +84,7 @@ describe('test/ts.test.js', () => {
return;
}
return coffee.fork(eggBin, [ 'test' ], { cwd })
// .debug()
.debug()
.expect('stdout', /hi, egg, 123456/)
.expect('code', 0)
.end();
Expand Down

0 comments on commit 937ed0d

Please sign in to comment.