18 lines
1 KiB
JavaScript
Executable file
18 lines
1 KiB
JavaScript
Executable file
const fs = require('fs');
|
|
|
|
const file = 'c:/ScriptoriumAI/scriptoriumai-ui/src/__tests__/Runboard.states.test.tsx';
|
|
let lines = fs.readFileSync(file, 'utf8').split('\n');
|
|
|
|
const startIdx = lines.findIndex(line => line.includes("executes compare-route project-filter clear from command bus action"));
|
|
const endIdx = lines.findIndex(line => line.includes("surfaces compare-route run selection blocker when compare route is inactive"));
|
|
|
|
if (startIdx !== -1 && endIdx !== -1) {
|
|
let before = lines.slice(0, startIdx);
|
|
// Find the previous empty line to keep it clean (optional)
|
|
let after = lines.slice(endIdx - 1); // include the line before the next "it" if it's white space
|
|
|
|
fs.writeFileSync(file, [...before, ...after].join('\n'), 'utf8');
|
|
fs.writeFileSync('c:/ScriptoriumAI/scriptoriumai-ui/script_result.txt', `Cut from ${startIdx} to ${endIdx}\n`, 'utf8');
|
|
} else {
|
|
fs.writeFileSync('c:/ScriptoriumAI/scriptoriumai-ui/script_result.txt', `Failed: start=${startIdx}, end=${endIdx}\n`, 'utf8');
|
|
}
|