Open floriangeorgi opened 5 days ago
#!/usr/bin/env zx import {$} from 'zx' console.log($.sync`echo -e "Item1\nItem2\nItem3"`.lines());
This code should output: [ 'Item1', 'Item2', 'Item3' ] This is at least the behavior in version 8.1.4.
[ 'Item1', 'Item2', 'Item3' ]
It outputs an array with an empty string: [ '' ]
[ '' ]
zx
index.mjs
// index.mjs
import {$} from 'zx' console.log($.syncecho -e "Item1\nItem2\nItem3".lines());
echo -e "Item1\nItem2\nItem3"
2. Make it executable. `chmod +x index.mjs` 3. Run it with `zx index.mjs` ### Specifications - zx version: 8.1.8 - Platform: ~~windows~~ / ~~macos~~ / linux - Runtime: node / ~~deno~~ / ~~bun~~
@floriangeorgi,
Thanks for the report. The fix is on the way.
Expected Behavior
This code should output:
[ 'Item1', 'Item2', 'Item3' ]
This is at least the behavior in version 8.1.4.Actual Behavior
It outputs an array with an empty string:
[ '' ]
Steps to Reproduce
zx
and addindex.mjs
.!/usr/bin/env zx
import {$} from 'zx' console.log($.sync
echo -e "Item1\nItem2\nItem3"
.lines());