mirror of
https://github.com/ivabus/pantry
synced 2025-06-08 08:20:32 +03:00
Output full pkg-requirement for all modes of sort
This commit is contained in:
parent
c58d3db8c9
commit
af4d1da0ce
1 changed files with 16 additions and 7 deletions
|
@ -19,6 +19,7 @@ args:
|
||||||
import { pkg } from "utils"
|
import { pkg } from "utils"
|
||||||
import { usePantry, useFlags } from "hooks"
|
import { usePantry, useFlags } from "hooks"
|
||||||
import { hydrate } from "prefab"
|
import { hydrate } from "prefab"
|
||||||
|
import { PackageRequirement } from "types"
|
||||||
|
|
||||||
const flags = useFlags()
|
const flags = useFlags()
|
||||||
const pantry = usePantry()
|
const pantry = usePantry()
|
||||||
|
@ -32,14 +33,22 @@ const wet = await hydrate(dry, async (pkg, dry) => {
|
||||||
const deps = await pantry.getDeps(pkg)
|
const deps = await pantry.getDeps(pkg)
|
||||||
return dry ? [...deps.build, ...deps.runtime] : deps.runtime
|
return dry ? [...deps.build, ...deps.runtime] : deps.runtime
|
||||||
})
|
})
|
||||||
const gas = wet.dry.map(x => x.project)
|
|
||||||
|
|
||||||
if (Deno.env.get("GITHUB_ACTIONS")) {
|
if (Deno.env.get("GITHUB_ACTIONS")) {
|
||||||
const pre = wet.wet.map(x => `"${pkg.str(x)}"`)
|
const massage = (input: PackageRequirement[]) =>
|
||||||
console.log(`::set-output name=pkgs::${gas.join(" ")}`)
|
input.map(p => {
|
||||||
console.log(`::set-output name=pre-install::${pre.join(" ")}`)
|
let out = pkg.str(p)
|
||||||
} else if (flags.json) {
|
if (/[<>]/.test(out)) out = `"${out}"`
|
||||||
console.log(gas)
|
return out
|
||||||
|
}).join(" ")
|
||||||
|
|
||||||
|
console.log(`::set-output name=pkgs::${massage(wet.dry)}`)
|
||||||
|
console.log(`::set-output name=pre-install::${massage(wet.wet)}`)
|
||||||
} else {
|
} else {
|
||||||
console.log(gas.join("\n"))
|
const gas = wet.dry.map(x => pkg.str(x))
|
||||||
|
if (flags.json) {
|
||||||
|
console.log(gas)
|
||||||
|
} else {
|
||||||
|
console.log(gas.join("\n"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue