Actually run the top level await

This commit is contained in:
garronej 2023-02-04 20:50:53 +01:00
parent a787215c95
commit 1a9f6d10d4

View File

@ -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<string>(bin).map(async scriptPath => {
const promises = Object.values<string>(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);
};
})();