Skip to content

Commit

Permalink
Simplify build+install in build-all; use new api to build()
Browse files Browse the repository at this point in the history
  • Loading branch information
jhheider committed Jul 20, 2022
1 parent e3d02fc commit a3a7516
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/build-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@ async function buildIfNeeded({ project, install }: BuildOptions) {
for (const req of reqs) {
const build = { project: project.project, constraint: new semver.Range(req) }
try {
await buildIfNeeded({ project: build, install })
await buildIfNeeded({ project: build, install: false })
} catch (error) {
console.verbose({ couldntBuild: { project, req }, error })
}
}
if (install) {
const version = semver.maxSatisfying(versions, project.constraint)!
await doInstall({ project: project.project, version })
}
return
}

Expand Down Expand Up @@ -100,9 +104,9 @@ async function buildIfNeeded({ project, install }: BuildOptions) {
await buildIfNeeded({ project: dep, install: true })
}

await prepare(pkg)
try {
const path = await build({ pkg, deps })
const prebuild = async () => { await prepare(pkg) }
const path = await build({ pkg, deps, prebuild })
await link({ path, pkg })
results.built.push(`${pkg.project}-${pkg.version.version}`)
} catch (error) {
Expand Down

0 comments on commit a3a7516

Please sign in to comment.