@probelabs/probe 0.6.0-rc259 → 0.6.0-rc261

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -127,6 +127,8 @@ export function parseSimpleCommand(command) {
127
127
  /&&/, // Logical AND
128
128
  /\|\|/, // Logical OR
129
129
  /(?<!\\);/, // Command separator (but not escaped \;)
130
+ /\n/, // Newline command separator (multi-line commands)
131
+ /\r/, // Carriage return (CRLF line endings)
130
132
  /&$/, // Background execution
131
133
  /\$\(/, // Command substitution $()
132
134
  /`/, // Command substitution ``
@@ -260,6 +262,7 @@ export function isComplexPattern(pattern) {
260
262
  /&&/, // Logical AND
261
263
  /\|\|/, // Logical OR
262
264
  /;/, // Command separator
265
+ /\n/, // Newline command separator
263
266
  /&$/, // Background execution
264
267
  /\$\(/, // Command substitution $()
265
268
  /`/, // Command substitution ``
@@ -402,6 +402,29 @@ export class BashPermissionChecker {
402
402
  i++;
403
403
  continue;
404
404
  }
405
+ // Check for newline (command separator in multi-line scripts)
406
+ // Also handle \r\n (CRLF) line endings
407
+ if (char === '\n' || (char === '\r' && nextChar === '\n')) {
408
+ if (current.trim()) {
409
+ components.push(current.trim());
410
+ }
411
+ current = '';
412
+ if (char === '\r') {
413
+ i += 2; // Skip \r\n
414
+ } else {
415
+ i++;
416
+ }
417
+ continue;
418
+ }
419
+ if (char === '\r') {
420
+ // Bare \r without \n
421
+ if (current.trim()) {
422
+ components.push(current.trim());
423
+ }
424
+ current = '';
425
+ i++;
426
+ continue;
427
+ }
405
428
  }
406
429
 
407
430
  current += char;