Repository navigation
Closed
Labels
Description
First released MVP we can do something like:
echo "$(git log --pretty=format:'%h|%s|%aN|%aE|%aD' -n 2)" | lines | split-column "|" commit subject name email date to get:
> echo "$(git log --pretty=format:'%h|%s|%aN|%aE|%aD' -n 2)" | lines | split-column "|" commit name
---+---------+-----------------------------------------------------------
# | commit | name
---+---------+-----------------------------------------------------------
0 | 6551498 | Merge pull request #662 from jonathandturner/did_you_mean
1 | 074a76c | Fix test
---+---------+-----------------------------------------------------------
> ^echo "$(git log --pretty=format:'%h|%s|%aN|%aE|%aD' -n 2)" | lines | split-column "|" commit name
---+---------+-----------------------------------------------------------
# | commit | name
---+---------+-----------------------------------------------------------
0 | 6551498 | Merge pull request #662 from jonathandturner/did_you_mean
1 | 074a76c | Fix test
---+---------+-----------------------------------------------------------
This is no longer possible because (with expected output) due to, possibly, the way we are giving output back.
With latest build from source we get:
> echo "$(git log --pretty=format:'%h|%s|%aN|%aE|%aD' -n 2)" | lines | split-column "|" commit name
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━
commit │ name
───────────────────────────────┼──────
$(git log --pretty=format:'%h │ %s
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━
> ^echo "$(git log --pretty=format:'%h|%s|%aN|%aE|%aD' -n 2)" | lines | split-column "|" commit name
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━
commit │ name
───────────────────────────────┼──────
$(git log --pretty=format:'%h │ %s
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━
This is possibly because our built-in echo simply prints to output the string. Escape valve no longer gives expected behavior (which does in first released MVP) either.
Activity
[-]Escape valve command call.[/-][+]Calling externals commands expectations.[/+][-]Calling externals commands expectations.[/-][+]External commands call output expectations.[/+]sophiajt commentedon Sep 14, 2019
If I'm reading this right, this used to work because we were working through bash rather than nu being its own shell.
Have you tried calling out to sh with the text?
wycats commentedon Sep 14, 2019
It seems surprising that
^echodidn't work, no?andrasio commentedon Sep 14, 2019
@jonathandturner
andrasio commentedon Sep 14, 2019
@wycats Indeed. They work on the released version.
tweak `source` parsing to allow quotes around string (nushell#666)
tweak `source` parsing to allow quotes around string (#666)
v0.72 blog post (nushell#666)