GoogleCloudPlatform / GoogleCloudPlatform/gsutil

gsutil set cors returns success output in stderr and not stdout

Open
#867 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.