mirror of
https://github.com/ivabus/pantry
synced 2024-11-23 00:45:07 +03:00
Overlay ourselves before building
/opt is for builds, don’t run your main tea out of it
This commit is contained in:
parent
77a44f7424
commit
6d6ccf652b
5 changed files with 20 additions and 4 deletions
|
@ -77,6 +77,6 @@ scripts/ls.ts | xargs scripts/sort.ts | xargs scripts/build.ts
|
|||
|
||||
```sh
|
||||
for x in scripts/*.ts src/app.ts; do
|
||||
deno check --import-map=$SRCROOT/import-map.json $x
|
||||
deno check --unstable --import-map=$SRCROOT/import-map.json $x
|
||||
done
|
||||
```
|
||||
|
|
|
@ -22,4 +22,3 @@ test:
|
|||
test "$OUT" = "$INPUT"
|
||||
env:
|
||||
INPUT: Hello, World!
|
||||
|
||||
|
|
|
@ -38,6 +38,8 @@ if (usePrefix().string != "/opt") {
|
|||
throw new Error("builds must be performed in /opt (try TEA_PREFIX=/opt)")
|
||||
}
|
||||
|
||||
await overlay()
|
||||
|
||||
for (const rq of dry) {
|
||||
const pkg = await pantry.resolve(rq)
|
||||
|
||||
|
@ -64,3 +66,17 @@ await set_output("srcs-relative-paths", rv.compact(x => x.src?.relative({ to }))
|
|||
interface InstallationPlus extends Installation {
|
||||
src: Path
|
||||
}
|
||||
|
||||
///------------------------------------------------------------
|
||||
/// overlay ourselves onto the /opt pantry
|
||||
async function overlay() {
|
||||
const pantry_prefix = usePrefix().join("tea.xyz/var/pantry")
|
||||
const self = new URL(import.meta.url).path().join("../../projects")
|
||||
const to = pantry_prefix.join("projects")
|
||||
for await (const [path, {isFile}] of self.walk()) {
|
||||
if (isFile) {
|
||||
const dst = to.join(path.relative({ to: self }))
|
||||
path.cp({ into: dst.parent().mkpath() })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { useCellar, usePantry, usePrefix } from "hooks"
|
|||
import { link, hydrate } from "prefab"
|
||||
import { Installation, Package } from "types"
|
||||
import useShellEnv, { expand } from "hooks/useShellEnv.ts"
|
||||
import { run, undent, host, tuplize, panic } from "utils"
|
||||
import { run, undent, host, tuplize } from "utils"
|
||||
import { str as pkgstr } from "utils/pkg.ts"
|
||||
import fix_pkg_config_files from "./fix-pkg-config-files.ts"
|
||||
import Path from "path"
|
||||
|
|
|
@ -9,6 +9,7 @@ args:
|
|||
- --allow-read
|
||||
- --allow-write
|
||||
- --allow-env
|
||||
- --unstable
|
||||
- --import-map={{ srcroot }}/import-map.json
|
||||
---*/
|
||||
|
||||
|
@ -20,7 +21,7 @@ import { resolve, install, hydrate, link } from "prefab"
|
|||
import Path from "path"
|
||||
import * as ARGV from "./utils/args.ts"
|
||||
|
||||
const { debug } = useFlags()
|
||||
useFlags()
|
||||
|
||||
const pantry = usePantry()
|
||||
|
||||
|
|
Loading…
Reference in a new issue