Skip to content

Commit

Permalink
deno 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 29, 2024
1 parent 653cd58 commit 76a2944
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
]
}
},
"pkgx": "deno^1.33.3 npm",
"pkgx": "deno~1.40.2 npm",
"tasks": {
"test": "deno test --parallel --unstable --allow-env --allow-read --allow-net=dist.pkgx.dev,github.com,codeload.github.com --allow-write --allow-run=tar,uname,/bin/sh,foo,'C:\\Windows\\system32\\cmd.exe'",
"typecheck": "deno check --unstable ./mod.ts",
"test": "deno test --parallel --unstable-fs --allow-env --allow-read --allow-net=dist.pkgx.dev,github.com,codeload.github.com --allow-write --allow-run=tar,uname,/bin/sh,foo,'C:\\Windows\\system32\\cmd.exe'",
"typecheck": "deno check ./mod.ts",
"dnt": ".github/deno-to-node.ts"
},
"lint": {
Expand Down
6 changes: 4 additions & 2 deletions src/hooks/useSync.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// deno-lint-ignore-file no-deprecated-deno-api
// ^^ Deno.Command is not implemented for dnt shims yet
import { deno } from "../deps.ts"
const { streams: { writeAll } } = deno
import { flock } from "../utils/flock.deno.ts"
Expand Down Expand Up @@ -41,6 +39,8 @@ export default async function(logger?: Logger) {
// ∴ download the latest tarball and uncompress over the top
//FIXME deleted packages will not be removed with this method
const src = new URL(`https://github.com/pkgxdev/pantry/archive/refs/heads/main.tar.gz`)
// https://github.com/denoland/node_shims/issues/110
// deno-lint-ignore no-deprecated-deno-api
const proc = Deno.run({
cmd: ["tar", "xzf", "-", "--strip-components=1"],
cwd: pantry_dir.string,
Expand Down Expand Up @@ -77,6 +77,8 @@ export interface RunOptions {
async function run(opts: RunOptions) {
const cmd = opts.cmd.map(x => `${x}`)
const env = (({ HTTP_PROXY, HTTPS_PROXY }) => ({ HTTP_PROXY, HTTPS_PROXY }))(Deno.env.toObject())
// https://github.com/denoland/node_shims/issues/110
// deno-lint-ignore no-deprecated-deno-api
const proc = Deno.run({ ...opts, cmd, stdout: 'null', clearEnv: true, env })
try {
const exit = await proc.status()
Expand Down
4 changes: 1 addition & 3 deletions src/plumbing/install.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// deno-lint-ignore-file no-deprecated-deno-api
// ^^ dnt doesn’t support Deno.Command yet so we’re stuck with the deprecated Deno.run for now

import { Package, Installation, StowageNativeBottle } from "../types.ts"
import useOffLicense from "../hooks/useOffLicense.ts"
import useDownload from "../hooks/useDownload.ts"
Expand Down Expand Up @@ -49,6 +46,7 @@ export default async function install(pkg: Package, logger?: Logger): Promise<In
//NOTE ^^ inside pkgx prefix to avoid TMPDIR is on a different volume problems
})
const tar_args = compression == 'xz' ? 'xJf' : 'xzf' // laughably confusing
// deno-lint-ignore no-deprecated-deno-api
const untar = Deno.run({
cmd: ["tar", tar_args, "-", "--strip-components", (pkg.project.split("/").length + 1).toString()],
stdin: 'piped', stdout: "inherit", stderr: "inherit",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/host.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Deno.test({
}

async function run(cmd: string) {
// deno’s shims don’t support Deno.Command yet
// https://github.com/denoland/node_shims/issues/110
// deno-lint-ignore no-deprecated-deno-api
const proc = Deno.run({ cmd: cmd.split(" "), stdout: "piped" })
assert((await proc.status()).success)
Expand Down

0 comments on commit 76a2944

Please sign in to comment.