mirror of
https://github.com/ivabus/pantry
synced 2024-11-30 04:05:06 +03:00
8a59338e83
The `dry` packages end up being constraints for the whole graph which in cyclic situations prevents bootstrapping. Eg. llvm^12 cannot be built because sort insists that it depends on llvm^12 which is not yet bottled.
41 lines
908 B
TypeScript
Executable file
41 lines
908 B
TypeScript
Executable file
#!/usr/bin/env -S tea -E
|
|
|
|
/*---
|
|
args:
|
|
- deno
|
|
- run
|
|
- --allow-read
|
|
- --allow-env
|
|
- --import-map={{ srcroot }}/import-map.json
|
|
---*/
|
|
|
|
// sorts input for building
|
|
// does a full hydration, but only returns ordered, dry packages
|
|
|
|
|
|
import { pkg } from "utils"
|
|
import { usePantry, useFlags } from "hooks"
|
|
import { hydrate } from "prefab"
|
|
import * as ARGV from "./utils/args.ts"
|
|
import { set_output } from "./utils/gha.ts";
|
|
|
|
const flags = useFlags()
|
|
const pantry = usePantry()
|
|
|
|
const dry = await ARGV.toArray(ARGV.pkgs())
|
|
|
|
const wet = await hydrate(dry, async (pkg, dry) => {
|
|
const deps = await pantry.getDeps(pkg)
|
|
return dry ? [...deps.build, ...deps.runtime] : deps.runtime
|
|
})
|
|
|
|
if (Deno.env.get("GITHUB_ACTIONS")) {
|
|
await set_output('pkgs', wet.dry.map(pkg.str))
|
|
} else {
|
|
const gas = wet.dry.map(pkg.str)
|
|
if (flags.json) {
|
|
console.log(gas)
|
|
} else {
|
|
console.log(gas.join("\n"))
|
|
}
|
|
}
|