Procházet zdrojové kódy

Only store if the contents change

Steven Silvester před 7 roky
rodič
revize
aecd4c0a7a
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      scripts/src/utils.ts

+ 3 - 1
scripts/src/utils.ts

@@ -19,6 +19,7 @@ function getLernaPaths(): string[] {
   return paths;
 }
 
+
 /**
  * Get all of the core package paths.
  */
@@ -41,7 +42,8 @@ function getCorePaths(): string[] {
 export
 function ensurePackageData(data: any, pkgJsonPath: string): boolean {
   let text = JSON.stringify(sortPackageJson(data), null, 2) + '\n';
-  let orig = fs.readFileSync(pkgJsonPath, 'utf8').toString();
+  let origData = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8').toString());
+  let orig = JSON.stringify(sortPackageJson(origData), null, 2) + '\n';
   if (text !== orig) {
     fs.writeFileSync(pkgJsonPath, text, 'utf8');
     return true;