From 1a9f6d10d47ba04b0661e87a163ad6db8a063434 Mon Sep 17 00:00:00 2001 From: garronej Date: Sat, 4 Feb 2023 20:50:53 +0100 Subject: [PATCH] Actually run the top level await --- src/bin/tools/grant-exec-perms.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bin/tools/grant-exec-perms.ts b/src/bin/tools/grant-exec-perms.ts index dab91c6b..315f39bb 100644 --- a/src/bin/tools/grant-exec-perms.ts +++ b/src/bin/tools/grant-exec-perms.ts @@ -3,10 +3,10 @@ import { join as pathJoin } from "path"; import { constants } from "fs"; import { chmod, stat } from "fs/promises"; -async () => { - var { bin } = await import(pathJoin(getProjectRoot(), "package.json")); +(async () => { + const { bin } = await import(pathJoin(getProjectRoot(), "package.json")); - var promises = Object.values(bin).map(async scriptPath => { + const promises = Object.values(bin).map(async scriptPath => { const fullPath = pathJoin(getProjectRoot(), scriptPath); const oldMode = (await stat(fullPath)).mode; const newMode = oldMode | constants.S_IXUSR | constants.S_IXGRP | constants.S_IXOTH; @@ -14,4 +14,4 @@ async () => { }); await Promise.all(promises); -}; +})();