@aexol/axolotl-scripts 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/packages.ts +18 -0
package/package.json
CHANGED
package/src/packages.ts
CHANGED
|
@@ -70,6 +70,24 @@ const remapPackages = async () => {
|
|
|
70
70
|
`Updated "${packageJSON.name}" from "${packageJSON.version}" to "${mainVersionJSON.version}" and it's internal dependencies`,
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
+
|
|
74
|
+
// Sync docs package.json version
|
|
75
|
+
const docsPackagePath = path.join(process.cwd(), 'docs', 'package.json');
|
|
76
|
+
try {
|
|
77
|
+
const docsPackageString = await fs.readFile(docsPackagePath, 'utf-8');
|
|
78
|
+
const docsPackageJSON = JSON.parse(docsPackageString) as PackageJSON;
|
|
79
|
+
if (docsPackageJSON.version !== mainVersionJSON.version) {
|
|
80
|
+
docsPackageJSON.version = mainVersionJSON.version;
|
|
81
|
+
await fs.writeFile(docsPackagePath, JSON.stringify(docsPackageJSON, null, 2) + '\n');
|
|
82
|
+
console.log(`Updated docs version to "${mainVersionJSON.version}"`);
|
|
83
|
+
}
|
|
84
|
+
} catch (error) {
|
|
85
|
+
const err = error as NodeJS.ErrnoException;
|
|
86
|
+
if (err.code !== 'ENOENT') {
|
|
87
|
+
throw err;
|
|
88
|
+
}
|
|
89
|
+
console.warn('docs/package.json not found, skipping version sync');
|
|
90
|
+
}
|
|
73
91
|
};
|
|
74
92
|
|
|
75
93
|
remapPackages();
|