From a8f492e95a26f377f8e2bcd2103bf4fcf3c6d51f Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 30 Oct 2023 14:12:51 -0500 Subject: [PATCH] change/deno ~ remove unneeded top-level-await (requires Deno v1.30.0+) - `Deno.permissions.querySync()` added in Deno v1.30.0 (on 2023-01-25) - see [suggest: Deno.permissions.querySync](https://github.com/denoland/deno/issues/15576) - see [feat: Add sync APIs for "Deno.permissions"](https://github.com/denoland/deno/pull/17019) - see [v1.30.0](https://github.com/denoland/deno/releases/tag/v1.30.0) released on 2023-01-25 --- lib/platform-shims/deno.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/platform-shims/deno.ts b/lib/platform-shims/deno.ts index c07662e0e..5a0a486b8 100644 --- a/lib/platform-shims/deno.ts +++ b/lib/platform-shims/deno.ts @@ -22,9 +22,9 @@ const REQUIRE_DIRECTORY_ERROR = 'loading a directory of commands is not supported yet for ESM'; const DENO_ENV_PERMITTED: boolean = - (await Deno.permissions.query({name: 'env'})).state === 'granted'; + (Deno.permissions.querySync({name: 'env'})).state === 'granted'; const DENO_READ_CWD_PERMITTED: boolean = - (await Deno.permissions.query({name: 'read', path: '.'})).state === 'granted'; + (Deno.permissions.querySync({name: 'read', path: '.'})).state === 'granted'; // Deno removes argv[0] and argv[1] from Deno.args: const argv = ['deno run', ...Deno.args];