logging commands

This commit is contained in:
2025-11-29 22:46:28 -05:00
parent 99b06e342c
commit 4d2a156f0b
3 changed files with 31 additions and 14 deletions

13
src/utils.ts Normal file
View File

@@ -0,0 +1,13 @@
import { $ } from "bun";
export const l$ = (strings: TemplateStringsArray, ...values: any[]) => {
// Interleave the static strings with the evaluated values
const cmd = strings.reduce((acc, str, i) => {
const val = values[i - 1];
return acc + (i > 0 ? $.escape(val) : "") + str;
});
console.log(`> ${cmd.trim()}`);
return $(strings, ...values);
};