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

Adding --exit_on_results option to fix https://github.com/cmather/meteor-ddp-tools/issues/4 #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

arnaudsj
Copy link

When wanting to use DDP in a cli mode to execute a remote command, get the results and exit, found that this gets the job done. I welcome any feedback of course, if you feel there is a better way to get this achieved.

@deanrad
Copy link

deanrad commented Mar 20, 2015

Yes, this is for #4

@deanrad
Copy link

deanrad commented Mar 20, 2015

Can it exit with non-zero if call had an error ?

Dean Radcliffe and others added 2 commits March 20, 2015 11:25
@deanrad
Copy link

deanrad commented Mar 20, 2015

+1 This works, and returns exit codes for method calls that raise errors:

ddp --exit_on_results --port 8081 call forceMeteorError
[msg]: {"server_id":"0"}
[msg]: {"msg":"connected","session":"L6HyaDYaRHpDGpkL3"}
[call]: forceMeteorError []
[msg]: {"msg":"updated","methods":["1"]}
[msg]: {"msg":"result","id":"1","error":{"error":"foo","message":"[foo]","errorType":"Meteor.Error"}}
~/src/meteor-ddp-tools (master) $ echo $?
1
~/src/meteor-ddp-tools (master) $ ddp --exit_on_results --port 8081 call forceNonMeteorError
[msg]: {"server_id":"0"}
[msg]: {"msg":"connected","session":"6Rij3o7aRB8DtEYk7"}
[call]: forceNonMeteorError []
[msg]: {"msg":"updated","methods":["1"]}
[msg]: {"msg":"result","id":"1","error":{"error":500,"reason":"Internal server error","message":"Internal server error [500]","errorType":"Meteor.Error"}}
~/src/meteor-ddp-tools (master) $ echo $?
1

@diavrank
Copy link

is this feature going to be in this repo? or is it available in another repository?

@diavrank
Copy link

I already find it: https://www.npmjs.com/package/ddp-tools-jw .

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.

3 participants