Skip to content

Commit 00a0363

Browse files
committed
update api-diff for better way of calling oxide.ts
1 parent 7e34c11 commit 00a0363

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/deno/api-diff.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ async function getCommitRange(
8787
return { base: parents[0].sha, head }
8888
}
8989

90+
const specUrl = (commit: string) =>
91+
`https://raw.githubusercontent.com/oxidecomputer/omicron/${commit}/openapi/nexus.json`
92+
9093
async function genForCommit(commit: string, force: boolean) {
9194
const tmpDir = `/tmp/api-diff/${commit}`
9295
const alreadyExists = await exists(tmpDir + '/Api.ts')
@@ -95,7 +98,8 @@ async function genForCommit(commit: string, force: boolean) {
9598
if (force || !alreadyExists) {
9699
await $`rm -rf ${tmpDir}`
97100
await $`mkdir -p ${tmpDir}`
98-
await $`npm run --silent --prefix ../oxide.ts gen-from ${commit} ${tmpDir}`
101+
console.log(`Generating for ${commit}...`)
102+
await $`npx tsx ../oxide.ts/generator/index.ts ${specUrl(commit)} ${tmpDir}`
99103
await $`npx prettier --write --log-level error ${tmpDir}`
100104
}
101105

0 commit comments

Comments
 (0)