Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/core.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ var log = function(entry) {
stream.write(format(entry));
};
var SPACE_RE = /\s/;
var SYNTAX = "()[]{}<>;:+|&=";
var SYNTAX = "()[]{}<>;|&=";
var CMD_BREAK = "|&;><";
var RESERVED_WORDS = /* @__PURE__ */ new Set([
"if",
Expand Down
2 changes: 1 addition & 1 deletion src/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const log: Log = function (entry) {
}

const SPACE_RE = /\s/
const SYNTAX = '()[]{}<>;:+|&='
const SYNTAX = '()[]{}<>;|&='
const CMD_BREAK = '|&;><'
const RESERVED_WORDS = new Set([
'if',
Expand Down
4 changes: 3 additions & 1 deletion test/log.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ describe('log', () => {
`foo-extra --baz = b-a-z --bar = 'b-a-r' -q -u x`,
"$ \x1B[92mfoo-extra\x1B[39m --baz \x1B[31m=\x1B[39m b-a-z --bar \x1B[31m=\x1B[39m \x1B[93m'b-a-r'\x1B[39m -q -u x\n",
],
[`npm-run-all test:unit`, '$ \x1B[92mnpm-run-all\x1B[39m test:unit\n'],
[`git+ssh://host/path`, '$ \x1B[92mgit+ssh://host/path\x1B[39m\n'],
[
`while true; do "$" done`,
'$ \x1B[96mwhile\x1B[39m true\x1B[31m;\x1B[39m\x1B[96m do\x1B[39m \x1B[93m"$"\x1B[39m\x1B[96m done\x1B[39m\n',
Expand All @@ -189,7 +191,7 @@ describe('log', () => {
],
[
'echo 1+2 | bc',
'$ \x1B[92mecho\x1B[39m 1\x1B[31m+\x1B[39m2 \x1B[31m|\x1B[39m\x1B[92m bc\x1B[39m\n',
'$ \x1B[92mecho\x1B[39m 1+2 \x1B[31m|\x1B[39m\x1B[92m bc\x1B[39m\n',
],
[
'echo test &>> filepath',
Expand Down