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

Cannot pipe results to jq #53

Closed
yiwork opened this issue Mar 15, 2024 · 0 comments · Fixed by #69
Closed

Cannot pipe results to jq #53

yiwork opened this issue Mar 15, 2024 · 0 comments · Fixed by #69

Comments

@yiwork
Copy link
Contributor

yiwork commented Mar 15, 2024

Version of cli: pspace v1.8.0 (build date: Mar 15, 2024, 2:03 PM; commit: c4bbfdf)
OS: MacOS 12.7.3

Sample command:

pspace machine get <machine_id> -j -F state  | jq '.'

#error:
jq: parse error: Invalid numeric literal at line 1, column 2
error: Uncaught BrokenPipe: Broken pipe (os error 32)
    at async file:///home/runner/work/cli/cli/lib/loading.ts:33:21

To get around this error, I attempted to capture results into a variable then pipe to jq:

state_query=$(pspace machine get ps3w6f5y34e8 -j -F state)
echo $state_query | jq '.'

# error:
jq: parse error: Invalid numeric literal at line 1, column 2

Further examination:

echo $state_query > state_query.txt
vi state_query.txt 

# inside text looks like this:
^[[?25l㊂ Loading
^[[1A^[[J㊀ Loading
^[[1A^[[J^[[?25h{
  "state": "ready"
}

So it seems like the new feature of adding a prompt-like feature to let people know results are being fetched is making jq processing impossible.

ps-kwang added a commit that referenced this issue Apr 24, 2024
ps-kwang added a commit that referenced this issue Apr 25, 2024
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 a pull request may close this issue.

1 participant