-
Notifications
You must be signed in to change notification settings - Fork 1
/
ghjk.ts
68 lines (63 loc) · 1.82 KB
/
ghjk.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
export { sophon } from "./hack.ts";
import { config, install, task } from "./hack.ts";
import * as ports from "./ports/mod.ts";
import { sedLock } from "./std.ts";
config({
defaultBaseEnv: "test",
enableRuntimes: true,
});
// these are just for quick testing
install();
const DENO_VERSION = "1.44.2";
// these are used for developing ghjk
install(
ports.act(),
ports.pipi({ packageName: "pre-commit" })[0],
ports.cpy_bs(),
ports.deno_ghrel({ version: DENO_VERSION }),
);
task(
"lock-sed",
async ($) => {
const GHJK_VERSION = "0.2.1";
await sedLock(
$.path(import.meta.dirname!),
{
lines: {
"./.github/workflows/*.yml": [
[/(DENO_VERSION: ").*(")/, DENO_VERSION],
],
"./host/mod.ts": [
[/(GHJK_VERSION = ").*(")/, GHJK_VERSION],
],
"./install.sh": [
[/(GHJK_VERSION="\$\{GHJK_VERSION:-v).*(\}")/, GHJK_VERSION],
[/(DENO_VERSION="\$\{DENO_VERSION:-v).*(\}")/, DENO_VERSION],
],
"./README.md": [
[
/(.*\/metatypedev\/ghjk\/v)[^/]*(\/.*)/,
GHJK_VERSION,
],
],
},
ignores: [
// ignore this file to avoid hits on the regexps
`ghjk.ts`,
`.git`,
// TODO: std function for real ignore handling
...(await $.path(".gitignore").readText())
.split("\n")
.map((l) => l.trim())
.filter((line) => line.length > 0)
.map((l) => `${l}${l.endsWith("*") ? "" : "*"}`),
...(await $.path(".ghjk/.gitignore").readText())
.split("\n")
.map((l) => l.trim())
.filter((line) => line.length > 0)
.map((l) => `.ghjk/${l}${l.endsWith("*") ? "" : "*"}`),
],
},
);
},
);