mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 23:12:30 +02:00
test: relax sync-ecc shell parsing
This commit is contained in:
parent
2d1e384eef
commit
b5157f4ed1
1 changed files with 3 additions and 5 deletions
|
|
@ -8,11 +8,9 @@ const path = require('path');
|
|||
|
||||
const scriptPath = path.join(__dirname, '..', '..', 'scripts', 'sync-ecc-to-codex.sh');
|
||||
const source = fs.readFileSync(scriptPath, 'utf8');
|
||||
const runOrEchoStart = source.indexOf('run_or_echo() {');
|
||||
const runOrEchoEnd = source.indexOf('\n\nrequire_path() {', runOrEchoStart);
|
||||
const runOrEchoSource = runOrEchoStart >= 0 && runOrEchoEnd > runOrEchoStart
|
||||
? source.slice(runOrEchoStart, runOrEchoEnd)
|
||||
: '';
|
||||
const normalizedSource = source.replace(/\r\n/g, '\n');
|
||||
const runOrEchoMatch = normalizedSource.match(/^run_or_echo\(\)\s*\{[\s\S]*?^}/m);
|
||||
const runOrEchoSource = runOrEchoMatch ? runOrEchoMatch[0] : '';
|
||||
|
||||
function test(name, fn) {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue