Skip to content

apple m1 throw error #152

@scZhengChao

Description

@scZhengChao

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.spawnSafeSync = void 0;
const cross_spawn_1 = require("cross-spawn");
const defaultOptions = {
logStdErrOnError: true,
throwOnError: true,
};
const spawnSafeSync = (command, args, options) => {
const mergedOptions = Object.assign({}, defaultOptions, options);
const result = cross_spawn_1.sync(command, args, options);
if (result.error || result.status !== 0) {
if (mergedOptions.logStdErrOnError) {
if (result.stderr) {
console.error(result.stderr.toString());
}
else if (result.error) {
console.error(result.error);
}
}
if (mergedOptions.throwOnError) {
throw result;
}
}
return result;
};
exports.spawnSafeSync = spawnSafeSync;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions