Skip to content

Commit 8eae3a1

Browse files
committed
write tea.yaml in build dirs so magic just works
1 parent 0470f01 commit 8eae3a1

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

deno.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
"deno.land": "^1.30"
2020
}
2121
},
22-
"importMap": "https://raw.githubusercontent.com/teaxyz/cli/v0.26.4/import-map.json"
22+
"importMap": "https://raw.githubusercontent.com/teaxyz/cli/v0.27/import-map.json"
2323
}

libexec/stage.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env -S deno run --allow-net --allow-read --allow-env --allow-write
22

3-
import useShellEnv, { expand } from "hooks/useShellEnv.ts"
3+
import useShellEnv, { expand, flatten } from "hooks/useShellEnv.ts"
44
import { parseFlags } from "cliffy/flags/mod.ts"
55
import { useCellar, usePrefix } from "hooks"
66
import usePantry from "../lib/usePantry.ts"
77
import { host, undent } from "utils"
8-
import { parse } from "utils/pkg.ts"
8+
import { parse, str as pkgstr } from "utils/pkg.ts"
99
import Path from "path"
1010

1111
import tea_init from "../lib/init().ts"
@@ -83,6 +83,17 @@ const text = undent`
8383
/// write out build script
8484
const sh = srcdir.join("xyz.tea.build.sh").write({ text, force: true }).chmod(0o755)
8585

86+
/// write out tea.yaml so magic works
87+
import * as YAML from "deno/yaml/stringify.ts"
88+
89+
srcdir.join("tea.yaml").write({ text: YAML.stringify({
90+
env: flatten(env),
91+
dependencies: deps.reduce((acc, {pkg}) => {
92+
acc[pkg.project] = `=${pkg.version}`
93+
return acc
94+
}, {} as Record<string, string>)
95+
}), force: true })
96+
8697
/// copy in auxillary files from pantry directory
8798
for await (const [path, {isFile}] of pantry.getYAML(pkg).path.parent().ls()) {
8899
if (isFile) {

0 commit comments

Comments
 (0)