Skip to content

Commit

Permalink
Extend make-historical script to use objects.inv (#645)
Browse files Browse the repository at this point in the history
The API generation script is now able to work with `objects.inv` files
thanks to @frankharkins at
#522. This PR allows us to
copy over the objects.file when we want to make a version historical
running `npm run make-historical -- -p <projectName>`.
  • Loading branch information
arnaucasau authored Jan 18, 2024
1 parent 0d660c5 commit 01cdbef
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions scripts/commands/convertApiDocsToHistorical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ zxMain(async () => {

await mkdirp(projectNewHistoricalFolder);

copyApiDocsAndUpdateLinks(pkgName, versionWithoutPatch);
generateJsonFiles(
await copyApiDocsAndUpdateLinks(pkgName, versionWithoutPatch);
await generateJsonFiles(
pkgName,
packageInfo.version,
versionWithoutPatch,
projectNewHistoricalFolder,
);
copyImages(pkgName, versionWithoutPatch);
await copyImages(pkgName, versionWithoutPatch);
await copyObjectsInv(pkgName, versionWithoutPatch);
});

async function copyApiDocsAndUpdateLinks(
Expand Down Expand Up @@ -143,6 +144,14 @@ async function copyImages(pkgName: string, versionWithoutPatch: string) {
await $`find ${imageDirSource}/* -maxdepth 0 -type f | grep -v "release_notes" | xargs -I {} cp -a {} ${imageDirDest}`;
}

async function copyObjectsInv(pkgName: string, versionWithoutPatch: string) {
console.log("Copying objects.inv");
const sourceDir = `${getRoot()}/public/api/${pkgName}`;
const destDir = `${getRoot()}/public/api/${pkgName}/${versionWithoutPatch}`;
await mkdirp(destDir);
await $`cp -a ${sourceDir}/objects.inv ${destDir}`;
}

async function updateLinksFile(
pkgName: string,
versionWithoutPatch: string,
Expand Down

0 comments on commit 01cdbef

Please sign in to comment.