mirror of
https://github.com/ivabus/pantry
synced 2025-06-08 08:20:32 +03:00
Fix circular dependency in hooks
This commit is contained in:
parent
c7ec7f150c
commit
8d0ed6cb5c
4 changed files with 10 additions and 11 deletions
|
@ -13,7 +13,7 @@ args:
|
|||
--- */
|
||||
|
||||
import { Installation } from "types"
|
||||
import { useCellar, useCache, useFlags } from "hooks"
|
||||
import { useCellar, useCache, usePrefix, useFlags } from "hooks"
|
||||
import { run, parse_pkg_requirement } from "utils"
|
||||
import { crypto } from "deno/crypto/mod.ts"
|
||||
import { encode } from "deno/encoding/hex.ts"
|
||||
|
@ -80,7 +80,7 @@ export async function bottle({ path: kegdir, pkg }: Installation): Promise<Path>
|
|||
return 'accumulate'
|
||||
}
|
||||
})
|
||||
const relativePaths = files.map(x => x.relative({ to: cellar.prefix }))
|
||||
const relativePaths = files.map(x => x.relative({ to: usePrefix() }))
|
||||
const filelist = kegdir
|
||||
.join(filesListName)
|
||||
.write({
|
||||
|
@ -93,7 +93,7 @@ export async function bottle({ path: kegdir, pkg }: Installation): Promise<Path>
|
|||
cmd: [
|
||||
"tar", "zcf", tarball, "--files-from", filelist
|
||||
],
|
||||
cwd: cellar.prefix
|
||||
cwd: usePrefix()
|
||||
})
|
||||
|
||||
return tarball
|
||||
|
|
|
@ -16,20 +16,19 @@ import { usePantry } from "hooks"
|
|||
import build from "./build/build.ts"
|
||||
import { Package } from "types"
|
||||
import { parse_pkg_requirement } from "utils"
|
||||
import { useFlags, useCellar } from "hooks"
|
||||
import { useFlags, usePrefix } from "hooks"
|
||||
import * as semver from "semver"
|
||||
|
||||
useFlags()
|
||||
|
||||
const pantry = usePantry()
|
||||
const cellar = useCellar()
|
||||
const dry = Deno.args.map(parse_pkg_requirement)
|
||||
const gha = !!Deno.env.get("GITHUB_ACTIONS")
|
||||
const group_it = gha && dry.length > 1
|
||||
const rv: Package[] = []
|
||||
|
||||
if (cellar.prefix.string != "/opt") {
|
||||
console.error({ TEA_PREFIX: cellar.prefix.string })
|
||||
if (usePrefix().string != "/opt") {
|
||||
console.error({ TEA_PREFIX: usePrefix().string })
|
||||
throw new Error("builds must be performed in /opt (try TEA_PREFIX=/opt)")
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { useSourceUnarchiver, useCellar, usePantry, useCache } from "hooks"
|
||||
import { useSourceUnarchiver, useCellar, usePantry, useCache, usePrefix } from "hooks"
|
||||
import { link, hydrate } from "prefab"
|
||||
import { Installation, Package } from "types"
|
||||
import useShellEnv, { expand } from "hooks/useShellEnv.ts"
|
||||
|
@ -128,7 +128,7 @@ async function fix_macho(installation: Installation) {
|
|||
await run({
|
||||
cmd: [d.join('fix-machos.rb'), installation.path, ...walk],
|
||||
env: {
|
||||
TEA_PREFIX: cellar.prefix.string,
|
||||
TEA_PREFIX: usePrefix().string,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -12,9 +12,9 @@ args:
|
|||
---*/
|
||||
|
||||
import Path from "path"
|
||||
import { useFlags, useCellar } from "hooks"
|
||||
import { useFlags, usePrefix } from "hooks"
|
||||
|
||||
const prefix = new Path(`${useCellar().prefix}/tea.xyz/var/pantry/projects`)
|
||||
const prefix = new Path(`${usePrefix()}/tea.xyz/var/pantry/projects`)
|
||||
|
||||
interface Entry {
|
||||
project: string
|
||||
|
|
Loading…
Reference in a new issue