<commit_before>
import spawn from "../../util/spawn";
import mklog, {Logger} from "../../util/log";
const log = mklog("icacls");

interface IIcaclsOptions {
  path: string;
  sid: string;
  logger: Logger;
}

async function icacls (opts: IIcaclsOptions, reason: string, args: string[]) {
  const removeRes = await spawn.getOutput({
    command: "icacls",
    args,
    onToken:    (tok) => { log(opts, `[${reason} out] ${tok}`); },
    onErrToken: (tok) => { log(opts, `[${reason} err] ${tok}`); },
  });
  log(opts, `acl cleanup output:\n${removeRes}`);
}

async function removeGrants(opts: IIcaclsOptions, reason: string) {<commit_msg>cleaner log output + assert success for icacls<commit_after>
import spawn from "../../util/spawn";
import mklog, {Logger} from "../../util/log";
const log = mklog("icacls");

interface IIcaclsOptions {
  path: string;
  sid: string;
  logger: Logger;
}

async function icacls (opts: IIcaclsOptions, reason: string, args: string[]) {
  await spawn.assert({
    command: "icacls",
    args,
    onToken:    (tok) => { log(opts, `[${reason} out] ${tok}`); },
    onErrToken: (tok) => { log(opts, `[${reason} err] ${tok}`); },
  });
}

async function removeGrants(opts: IIcaclsOptions, reason: string) {
{'fraction_non_alphanumeric': 0.19174757281553398, 'fraction_numerical': 0.0, 'mean_word_length': 4.1115702479338845, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4095425', 'n_tokens_mistral': 427, 'n_tokens_neox': 436, 'n_words': 118}