Ver código fonte

Only edit tsconfig if it exists.

Ian Rose 6 anos atrás
pai
commit
ed9b099811
1 arquivos alterados com 5 adições e 3 exclusões
  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');