louisdh / openterm

OpenTerm, a sandboxed command line interface for iOS
Other
1.63k stars 249 forks source link

curl inside captureShell #153

Open matthiaw opened 6 years ago

matthiaw commented 6 years ago

I tried to make a script with

_info = captureShell("curl --request GET --url 'https://your-domain.atlassian.net/wiki/rest/api/settings/systemInfo' --user 'email@example.com:' --header 'Accept: application/json')_ println(info)

I use for this https://developer.atlassian.com/cloud/confluence/rest/#api-settings-systemInfo-get

I have a working account at confluence and on OpenTerm everything works perfect with the curl-command.

But in script-mode i get the correct REST-Result and

{json-result}curl: (6) Could not resolve host: --request curl: (6) Could not resolve host: GET curl: (6) Could not resolve host: --url curl: (6) Could not resolve host: --user curl: (3) Port number ended with 'c' curl: (6) Could not resolve host: --header curl: (3) Port number ended with ' '

This seems strange. Need i to escape something?

matthiaw commented 6 years ago

Ok i found a workaround-solution over a temporary file:

captureShell("curl --request ... | tee tmp.txt") info = captureShell("cat tmp.txt") println(info) captureShell("rm tmp.txt")