File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 22"use strict" ;
33
44import path = require( "path" ) ;
5+ import os = require( "os" ) ;
56
67export class ProjectData implements IProjectData {
78 public projectDir : string ;
@@ -28,8 +29,16 @@ export class ProjectData implements IProjectData {
2829 this . projectFilePath = path . join ( projectDir , this . $staticConfig . PROJECT_FILE_NAME ) ;
2930
3031 if ( this . $fs . exists ( this . projectFilePath ) . wait ( ) ) {
32+ try {
3133 var fileContent = this . $fs . readJson ( this . projectFilePath ) . wait ( ) ;
3234 this . projectId = fileContent . id ;
35+ } catch ( err ) {
36+ this . $errors . fail ( { formatStr : "The project file %s is corrupted." + os . EOL +
37+ "Consider restoring an earlier version from your source control or backup." + os . EOL +
38+ "Additional technical info: %s" ,
39+ suppressCommandHelp : true } ,
40+ this . projectFilePath , err . toString ( ) ) ;
41+ }
3342 }
3443 } else {
3544 this . $errors . fail ( "No project found at or above '%s' and neither was a --path specified." , process . cwd ( ) ) ;
You can’t perform that action at this time.
0 commit comments