keycloak_theme/src/bin/tools/grant-exec-perms.ts

12 lines
503 B
TypeScript
Raw Normal View History

import { getProjectRoot } from "./getProjectRoot";
import { join as pathJoin } from "path";
import { chmodSync, statSync, constants } from "fs";
2021-02-28 18:40:57 +01:00
import(pathJoin(getProjectRoot(), "package.json")).then(({ bin }) => {
Object.entries<string>(bin).forEach(([, scriptPath]) => {
const fullPath = pathJoin(getProjectRoot(), scriptPath);
const newMode = statSync(fullPath).mode | constants.S_IXUSR | constants.S_IXGRP | constants.S_IXOTH;
chmodSync(fullPath, newMode);
});
});