Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return result of shell as string #166

Merged
merged 2 commits into from
Jun 2, 2021
Merged

Return result of shell as string #166

merged 2 commits into from
Jun 2, 2021

Conversation

JJK96
Copy link
Contributor

@JJK96 JJK96 commented Jun 2, 2021

I ran into the issue that if I insert the result of a shell command (using !), I get the result as a JSON object.

So I execute the following command: #echo test
And I get the following output:

{"val":"test"}

This PR returns the result of executing a command as a string. So it would return "test" instead.
I don't know why the previous version returned the result as a JSON object, i.e. which usecase it is for. But this solution fits my usecase.

Copy link
Owner

@71 71 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good catch; thanks for the PR! I was pretty sure I had already done this, but I guess not. Two changes are necessary to throw errors rather than strings, and it will be good to go.

For reference, the code used those objects because Dance did not correctly support errors in previous versions. It was updated in 0.5, but that specific function was forgotten.

@71 71 merged commit 1fedcd9 into 71:master Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants