GoogleCloudPlatform / GoogleCloudPlatform/gsutil
gsutil set cors returns success output in stderr and not stdout
Open
- Dominant language
- Python
- Stars
- 918
- Forks
- 335
- PR merge metrics
- No merged PRs in 30d
Description
```
const util = require("util");
const child_process = require('child_process');
const exec = util.promisify(child_process.exec);
async function runCommand2(command) {
console.log(`Executing \`${command}\``);
const res = await exec(command);
const {stdout, stderr} = res
console.log(res);
if (stderr) {
throw new Error(stderr);
}
return stdout;
}
runCommand2(`gsutil cors set cors.json gs://bucketName`)
```
ends up throwing error since stderr has data, but the call succeeds:
```
{ stdout: '',
stderr: 'Setting CORS on gs://bucketName/...\n' }
```
Contributor guide
Assessment
This issue has not been assessed yet.