MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / run

Function run

scripts/build-cli.mjs:92–111  ·  view source on GitHub ↗
(command, args, options = {})

Source from the content-addressed store, hash-verified

90}
91
92function run(command, args, options = {}) {
93 const spawnOptions = {
94 cwd: rootDir,
95 stdio: options.encoding ? ["ignore", "pipe", "inherit"] : "inherit",
96 };
97 if (options.encoding) {
98 spawnOptions.encoding = options.encoding;
99 }
100 const result = spawnSync(command, args, spawnOptions);
101 if (result.error) {
102 if (options.optional) {
103 return result;
104 }
105 throw result.error;
106 }
107 if (result.status !== 0 && !options.optional) {
108 process.exit(result.status ?? 1);
109 }
110 return result;
111}

Callers 1

build-cli.mjsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected