소스 검색

Only edit tsconfig if it exists.

Ian Rose 6 년 전
부모
커밋
ed9b099811
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      buildutils/src/add-sibling.ts

+ 5 - 3
buildutils/src/add-sibling.ts

@@ -53,9 +53,11 @@ if (fs.existsSync(path.join(packagePath, 'node_modules'))) {
 
 // Make sure composite is set to true in the new package.
 let packageTsconfigPath = path.join(packagePath, 'tsconfig.json');
-let packageTsconfig = utils.readJSONFile(packageTsconfigPath);
-packageTsconfig.compilerOptions.composite = true;
-utils.writeJSONFile(packageTsconfigPath, packageTsconfig);
+if (fs.existsSync(packageTsconfigPath)) {
+  let packageTsconfig = utils.readJSONFile(packageTsconfigPath);
+  packageTsconfig.compilerOptions.composite = true;
+  utils.writeJSONFile(packageTsconfigPath, packageTsconfig);
+}
 
 // Get the package.json of the extension.
 let pkgJSONPath = path.join(packagePath, 'package.json');