fix: cargo metadata with large project (#1117)

Set `maxBuffer` to 10mb, cargo metadata may output
data more than 1mb(the nodejs default value).

Refs:
- https://github.com/napi-rs/napi-rs/issues/1116
This commit is contained in:
killa 2022-04-02 00:40:13 +08:00 committed by LongYinan
parent dc87c46322
commit 6bef28a59b
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -213,6 +213,7 @@ export class BuildCommand extends Command {
const cargoMetadata = JSON.parse(
execSync('cargo metadata --format-version 1', {
stdio: 'pipe',
maxBuffer: 1024 * 1024 * 10,
}).toString('utf8'),
)
const packages = cargoMetadata.packages