Skip to content

Commit

Permalink
fix(ods): update generate doc script for releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
stevering committed Feb 28, 2023
1 parent 52b2954 commit ce6cdf0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/generate-ods-doc.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env zx
/**
* execution from monorepo
* generate doc based on available packages from artifactory
* execution from monorepo.
* `npx zx scripts/generate-ods-doc.mjs https://path-to-registry username token`
* OR
* `npx zx scripts/generate-ods-doc.mjs https://path-to-registry userToken`
Expand Down Expand Up @@ -59,17 +60,17 @@ if (!userToken && (!username || !token)) {
headers.append('Authorization', authorizationHeaderValue);
const data = await fetch(registry, {headers: headers})
.then(r => {
console.log('data before converted to json:', r);
return r.json()
});

console.log(JSON.stringify({detectedVersions: Object.keys(data.versions)}, undefined, 2));

await $`rm -rf dist`;
await $`mkdir -p dist`;

if (!data || data.error || data.error || !data.versions) {
console.error(`something went wrong with the response. it will consider only the current storybook build to integrate`, {response: data});
} else {
console.log(JSON.stringify({detectedVersions: Object.keys(data.versions)}, undefined, 2));
for (const version in data.versions) {
const versionMeta = data.versions[version];

Expand Down

0 comments on commit ce6cdf0

Please sign in to comment.