2022-08-05 04:19:01 +03:00
|
|
|
#!/usr/bin/env -S tea -E
|
|
|
|
|
|
|
|
/*---
|
|
|
|
args:
|
|
|
|
- deno
|
|
|
|
- run
|
|
|
|
- --allow-net
|
|
|
|
- --allow-run
|
|
|
|
- --allow-read=/opt,/Library/Developer/CommandLineTools
|
|
|
|
- --allow-write=/opt
|
|
|
|
- --allow-env
|
|
|
|
- --import-map={{ srcroot }}/import-map.json
|
|
|
|
---*/
|
|
|
|
|
|
|
|
import { parsePackageRequirement } from "types"
|
|
|
|
import hydrate from "prefab/hydrate.ts"
|
2022-08-10 21:58:22 +03:00
|
|
|
import { get_build_deps } from "./_lib.ts"
|
|
|
|
|
|
|
|
//<FIXME>
|
|
|
|
import { print } from "utils"
|
|
|
|
print("this because otherwise console.verbose is not defined lol")
|
|
|
|
//</FIXME>
|
2022-08-05 04:19:01 +03:00
|
|
|
|
|
|
|
const dry = Deno.args.map(project => {
|
|
|
|
const match = project.match(/projects\/(.*)\/package.yml/)
|
|
|
|
return match ? match[1] : project
|
|
|
|
}).map(parsePackageRequirement)
|
|
|
|
|
|
|
|
const set = new Set(dry.map(x => x.project))
|
2022-08-10 21:58:22 +03:00
|
|
|
const wet = await hydrate(dry, get_build_deps(set))
|
|
|
|
const gas = wet.map(x => x.project)
|
|
|
|
.filter(x => set.has(x)) // we're only sorting `dry` so reject the rest
|
2022-08-05 04:19:01 +03:00
|
|
|
|
2022-08-10 21:58:22 +03:00
|
|
|
console.log(`::set-output name=pkgs::${gas.join(" ")}`)
|