|
1 | 1 | #!/usr/bin/env -S deno run --allow-net --allow-read --allow-env --allow-write |
2 | 2 |
|
3 | | -import useShellEnv, { expand } from "hooks/useShellEnv.ts" |
| 3 | +import useShellEnv, { expand, flatten } from "hooks/useShellEnv.ts" |
4 | 4 | import { parseFlags } from "cliffy/flags/mod.ts" |
5 | 5 | import { useCellar, usePrefix } from "hooks" |
6 | 6 | import usePantry from "../lib/usePantry.ts" |
7 | 7 | import { host, undent } from "utils" |
8 | | -import { parse } from "utils/pkg.ts" |
| 8 | +import { parse, str as pkgstr } from "utils/pkg.ts" |
9 | 9 | import Path from "path" |
10 | 10 |
|
11 | 11 | import tea_init from "../lib/init().ts" |
@@ -83,6 +83,17 @@ const text = undent` |
83 | 83 | /// write out build script |
84 | 84 | const sh = srcdir.join("xyz.tea.build.sh").write({ text, force: true }).chmod(0o755) |
85 | 85 |
|
| 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 | + |
86 | 97 | /// copy in auxillary files from pantry directory |
87 | 98 | for await (const [path, {isFile}] of pantry.getYAML(pkg).path.parent().ls()) { |
88 | 99 | if (isFile) { |
|
0 commit comments