diff --git a/package.json b/package.json index 5804ab0..fcdd9d4 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "license": "MIT", "main": "./lib/CLI.js", "typings": "./lib/index.d.ts", - "version": "2.0.0-alpha-6", + "version": "2.0.0-alpha-7", "dependencies": { "chalk": "^2.3.0" }, diff --git a/src/Core/Actions/Typings.ts b/src/Core/Actions/Typings.ts index 124a43e..4dbb275 100644 --- a/src/Core/Actions/Typings.ts +++ b/src/Core/Actions/Typings.ts @@ -28,22 +28,26 @@ class Script extends UpdateScript { } public async exec(rootpath: string): Promise { - this.log.task('exec', rootpath) - const project = await Project.load(rootpath) + try { + this.log.task('exec', rootpath) + const project = await Project.load(rootpath) - if (project === Project.InvalidProject) { - this.log.error(`failed to load any projects at ${rootpath}`) - return - } + if (project === Project.InvalidProject) { + this.log.error(`failed to load any projects at ${rootpath}`) + return + } - const tsconfig = await project.json('tsconfig.json') - tsconfig.compilerOptions.types = await this.gatherTypeDefinitions(project) + const tsconfig = await project.json('tsconfig.json') + tsconfig.compilerOptions.types = await this.gatherTypeDefinitions(project) - if (this.testing) { - this.log.task('tsconfig', JSON.stringify(tsconfig, null, 2)) - } else { - await project.save('tsconfig.json', tsconfig) - this.log.task('tsconfig') + if (this.testing) { + this.log.task('tsconfig', JSON.stringify(tsconfig, null, 2)) + } else { + await project.save('tsconfig.json', tsconfig) + this.log.task('tsconfig') + } + } catch (error) { + this.log.error(error) } }