Skip to content

Commit 7f3f6fa

Browse files
committed
lock deno to v1 for now
1 parent e0f7006 commit 7f3f6fa

10 files changed

Lines changed: 42 additions & 42 deletions

File tree

.github/workflows/ci.cli.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- uses: pkgxdev/setup@v2
3737

3838
- name: precache # makes it easier to read the real output
39-
run: pkgx deno cache test/test.ts build/build.ts
39+
run: pkgx deno^1 cache test/test.ts build/build.ts
4040

4141
- run: bin/bk build ${{matrix.pkg}}
4242
- run: bin/bk test ${{matrix.pkg}}

audit/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ runs:
2626
run: |
2727
echo "::group::fetch deno deps"
2828
cd $GITHUB_ACTION_PATH
29-
pkgx deno cache ./audit.ts
29+
pkgx deno^1 cache ./audit.ts
3030
echo "::endgroup::"
3131
3232
- run: ${GITHUB_ACTION_PATH}/audit.ts '${{ inputs.pkg }}'

build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ runs:
4949
run: |
5050
echo "::group::fetch deno deps"
5151
cd $GITHUB_ACTION_PATH
52-
pkgx deno cache ./build.ts
52+
pkgx deno^1 cache ./build.ts
5353
echo "::endgroup::"
5454
5555
- name: build

download-build-artifact/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ runs:
5252
shell: bash
5353
run: |
5454
echo "::group::fetch deno deps"
55-
pkgx deno cache ${GITHUB_ACTION_PATH}/../lib/actions/*.ts --config=${GITHUB_ACTION_PATH}/../deno.jsonc
55+
pkgx deno^1 cache ${GITHUB_ACTION_PATH}/../lib/actions/*.ts --config=${GITHUB_ACTION_PATH}/../deno.jsonc
5656
echo "::endgroup::"
5757
5858
- name: prep

id/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ runs:
4040
run: |
4141
echo "::group::fetch deno deps"
4242
cd ${GITHUB_ACTION_PATH}
43-
pkgx deno cache ./id.ts
43+
pkgx deno^1 cache ./id.ts
4444
echo "::endgroup::"
4545
shell: bash
4646

lib/actions/platform-key.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env -S pkgx deno run --allow-env --allow-read
1+
#!/usr/bin/env -S pkgx deno^1 run --allow-env --allow-read
22

33
import { Command } from "cliffy/command/mod.ts"
44
import get_config from '../resolve-pkg.ts'

lib/actions/stage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env -S pkgx deno run --allow-read --allow-env --allow-write
1+
#!/usr/bin/env -S pkgx deno^1 run --allow-read --allow-env --allow-write
22

33
import { hooks, Path } from "pkgx"
44
import get_config from '../resolve-pkg.ts'

libexec/fix-shebangs.ts

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
#!/usr/bin/env -S pkgx deno run -A
1+
#!/usr/bin/env -S pkgx deno^1 run -A
22

3-
import { Path } from "pkgx"
4-
import undent from "outdent"
3+
import { Path } from "pkgx";
4+
import undent from "outdent";
55

66
const has_shebang = (() => {
7-
const encoder = new TextDecoder()
7+
const encoder = new TextDecoder();
88
return (buf: Uint8Array) => {
9-
return encoder.decode(buf) == '#!'
10-
}
11-
})()
9+
return encoder.decode(buf) == "#!";
10+
};
11+
})();
1212

1313
for (const path of Deno.args) {
14-
if (!Path.cwd().join(path).isFile()) continue
14+
if (!Path.cwd().join(path).isFile()) continue;
1515

16-
console.debug({ path })
16+
console.debug({ path });
1717

18-
const rid = await Deno.open(path, { read: true })
18+
const rid = await Deno.open(path, { read: true });
1919
try {
20-
const buf = new Uint8Array(2)
21-
await rid.read(buf)
22-
if (!has_shebang(buf)) continue
20+
const buf = new Uint8Array(2);
21+
await rid.read(buf);
22+
if (!has_shebang(buf)) continue;
2323
} finally {
24-
rid.close()
24+
rid.close();
2525
}
2626

2727
//FIXME this could be pretty damn efficient if we can find the time
2828
//NOTE as it stands this is HIDEOUSLY inefficient
2929

30-
const contents = await Deno.readFile(path)
31-
const txt = new TextDecoder().decode(contents)
32-
const [line0, ...lines] = txt.split("\n") //lol
30+
const contents = await Deno.readFile(path);
31+
const txt = new TextDecoder().decode(contents);
32+
const [line0, ...lines] = txt.split("\n"); //lol
3333

34-
const match = line0.match(/^#!\s*(\/[^\s]+)/)
35-
if (!match) throw new Error()
36-
const interpreter = match[1]
34+
const match = line0.match(/^#!\s*(\/[^\s]+)/);
35+
if (!match) throw new Error();
36+
const interpreter = match[1];
3737

3838
switch (interpreter) {
39-
case "/usr/bin/env":
40-
case "/bin/sh":
41-
console.log({ line0, path })
42-
console.log("^^ skipped acceptable shebang")
43-
continue
39+
case "/usr/bin/env":
40+
case "/bin/sh":
41+
console.log({ line0, path });
42+
console.log("^^ skipped acceptable shebang");
43+
continue;
4444
}
4545

46-
const shebang = `#!/usr/bin/env ${new Path(interpreter).basename()}`
46+
const shebang = `#!/usr/bin/env ${new Path(interpreter).basename()}`;
4747

4848
const rewrite = undent`
4949
${shebang}
5050
${lines.join("\n")}
51-
`
51+
`;
5252

53-
console.log({rewrote: path, to: `#!/usr/bin/env ${interpreter}`})
53+
console.log({ rewrote: path, to: `#!/usr/bin/env ${interpreter}` });
5454

55-
const stat = Deno.lstatSync(path)
56-
const needs_chmod = stat.mode && !(stat.mode & 0o200)
57-
if (needs_chmod) Deno.chmodSync(path, 0o666)
58-
await Deno.writeFile(path, new TextEncoder().encode(rewrite))
59-
if (needs_chmod) Deno.chmodSync(path, stat.mode!)
55+
const stat = Deno.lstatSync(path);
56+
const needs_chmod = stat.mode && !(stat.mode & 0o200);
57+
if (needs_chmod) Deno.chmodSync(path, 0o666);
58+
await Deno.writeFile(path, new TextEncoder().encode(rewrite));
59+
if (needs_chmod) Deno.chmodSync(path, stat.mode!);
6060
}

test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ runs:
2424
run: |
2525
echo "::group::fetch deno deps"
2626
cd ${GITHUB_ACTION_PATH}
27-
pkgx deno cache ./test.ts
27+
pkgx deno^1 cache ./test.ts
2828
echo "::endgroup::"
2929
3030
- name: test

upload-build-artifact/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ runs:
2424
shell: bash
2525
run: |
2626
echo "::group::fetch deno deps"
27-
pkgx deno cache ${GITHUB_ACTION_PATH}/../lib/actions/*.ts --config=${GITHUB_ACTION_PATH}/../deno.jsonc
27+
pkgx deno^1 cache ${GITHUB_ACTION_PATH}/../lib/actions/*.ts --config=${GITHUB_ACTION_PATH}/../deno.jsonc
2828
echo "::endgroup::"
2929
3030
# we must tar because the upload action loses file permissions 😕

0 commit comments

Comments
 (0)