From 8645909fd5f1990d3172105d606ddd9b705df443 Mon Sep 17 00:00:00 2001 From: sebseb7 Date: Mon, 11 Aug 2025 22:39:25 +0200 Subject: [PATCH] Refactor ripgrep tool to use ES module syntax for importing spawnSync, improving consistency with modern JavaScript practices. This change removes the CommonJS require statement, enhancing code clarity. --- tools/ripgrep.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/ripgrep.js b/tools/ripgrep.js index cfa107e..ba0650a 100644 --- a/tools/ripgrep.js +++ b/tools/ripgrep.js @@ -1,3 +1,5 @@ +import { spawnSync } from "node:child_process"; + const virtual_chroot = '/home/seb/src/aiTools/tmp'; export default { @@ -29,7 +31,6 @@ export async function run(args) { rgArgs.push('--', pattern); try { - const { spawnSync } = require('child_process'); const proc = spawnSync('rg', rgArgs, { cwd: virtual_chroot, encoding: 'utf8',