Skip to content

Commit

Permalink
run deno fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
NeKzor committed May 14, 2024
1 parent e6aeb73 commit 6620b3f
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/cmm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,19 @@ const validateApiKey = async (apiKey: string) => {
};

const enableVirtualTerminalProcessing = () => {
const kernel32 = Deno.dlopen("kernel32.dll", {
const kernel32 = Deno.dlopen('kernel32.dll', {
GetStdHandle: {
parameters: ["u32"],
result: "pointer"
parameters: ['u32'],
result: 'pointer',
},
GetConsoleMode: {
parameters: ["pointer", "buffer"],
result: "bool"
parameters: ['pointer', 'buffer'],
result: 'bool',
},
SetConsoleMode: {
parameters: ["pointer", "u32"],
result: "bool"
}
parameters: ['pointer', 'u32'],
result: 'bool',
},
});

const STD_OUTPUT_HANDLE = 4294967285;
Expand All @@ -205,13 +205,13 @@ const enableVirtualTerminalProcessing = () => {

const buffer = new Uint32Array(1).fill(0);
kernel32.symbols.GetConsoleMode(handle, buffer);

let consoleMode = buffer[0];
if (consoleMode) {
consoleMode = consoleMode | ENABLE_VIRTUAL_TERMINAL_PROCESSING;
kernel32.symbols.SetConsoleMode(handle, consoleMode);
}
}
};

const cli = new Command()
.name('cmm')
Expand All @@ -221,8 +221,9 @@ const cli = new Command()
.action(async (option) => {
verbose = !!option.verbose;

if (isWindows)
if (isWindows) {
enableVirtualTerminalProcessing();
}

const gameSelect = await Select.prompt({
message: 'Choose which game to install the mod to:',
Expand Down

0 comments on commit 6620b3f

Please sign in to comment.