Skip to content

Commit

Permalink
some feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaucasau committed Feb 1, 2024
1 parent e938de9 commit 2eb99f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
File renamed without changes.
7 changes: 2 additions & 5 deletions scripts/commands/updateApiDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface Arguments {
package: string;
version: string;
historical: boolean;
"skip-download": boolean;
skipDownload: boolean;
}

const readArgs = (): Arguments => {
Expand Down Expand Up @@ -98,10 +98,7 @@ zxMain(async () => {
);

const artifactFolder = pkg.ciArtifactFolder();
if (
args["skip-download"] &&
(await pathExists(`${artifactFolder}/artifact`))
) {
if (args.skipDownload && (await pathExists(`${artifactFolder}/artifact`))) {
console.log(`Skip downloading sources for ${pkg.name}:${pkg.version}`);
} else {
await downloadCIArtifact(pkg, artifactFolder);
Expand Down
9 changes: 4 additions & 5 deletions scripts/lib/api/apiArtifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,15 @@ export async function downloadCIArtifact(pkg: Pkg, artifactFolder: string) {
}

const artifactJson = JSON.parse(
fs.readFileSync(
`${getRoot()}/scripts/lib/api/api-html-artifacts.json`,
"utf-8",
),
fs.readFileSync(`${getRoot()}/scripts/api-html-artifacts.json`, "utf-8"),
);

if (!(`${pkg.versionWithoutPatch}` in artifactJson[`${pkg.name}`])) {
throw new Error(
`Package ${pkg.name} version ${pkg.versionWithoutPatch} doesn't have an artifact stored. You can add one to https://ibm.ent.box.com/folder/246867452622
following the steps detailed in the \`Generate the API docs\` section on the repo's README`,
following the steps detailed in the \`Generate the API docs\` section on the repo's README. If you are not an IBMer with access to the Box folder,
you can ask in your pull request for a maintainer to help you. In the meantime, you can use another URL in api-html-artifacts.json, such as GitHub or
even localhost for a server you start up; the URL needs to result in downloading the zip file.`,
);
}
const artifactUrl = artifactJson[`${pkg.name}`][`${pkg.versionWithoutPatch}`];
Expand Down

0 comments on commit 2eb99f0

Please sign in to comment.