Skip to content

Commit

Permalink
trim striped ansi messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bameyrick committed Oct 3, 2024
1 parent 83ed8a2 commit 4e29790
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/concurrently.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as chalk from 'chalk';
import stripAnsi from 'strip-ansi';
import { ConcurrentCommand } from './command';
import { getName } from './get-name';
import { logError } from './log-error';
import { runCommand } from './run-command';
import { stripAnsiAndChalk } from './strip-ansi-and-chalk';
import { WaitCondition } from './wait-condition';

/**
Expand Down Expand Up @@ -46,7 +46,7 @@ export function concurrently(commands: ConcurrentCommand[], index = 0): void {
}
case WaitCondition.Includes: {
runCommand(command.command, index, name, command.longestName, message => {
if (!conditionMet && stripAnsiAndChalk(message).toLowerCase().includes(command.value!.toLowerCase())) {
if (!conditionMet && stripAnsi(message).trim().toLowerCase().includes(command.value!.toLowerCase())) {
conditionMet = true;

concurrently(commands, nextIndex);
Expand All @@ -64,7 +64,7 @@ export function concurrently(commands: ConcurrentCommand[], index = 0): void {
}
case WaitCondition.Matches: {
runCommand(command.command, index, name, command.longestName, message => {
if (!conditionMet && stripAnsiAndChalk(message) === command.value) {
if (!conditionMet && stripAnsi(message).trim() === command.value?.trim()) {
conditionMet = true;

concurrently(commands, nextIndex);
Expand Down
5 changes: 0 additions & 5 deletions src/strip-ansi-and-chalk.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/strip-ansi.ts

This file was deleted.

0 comments on commit 4e29790

Please sign in to comment.