MCPcopy
hub / github.com/philc/vimium / shell

Function shell

make.js:17–30  ·  view source on GitHub ↗
(procName, argsArray = [])

Source from the content-addressed store, hash-verified

15const projectPath = new URL(".", import.meta.url).pathname;
16
17async function shell(procName, argsArray = []) {
18 // NOTE(philc): Does drake's `sh` function work on Windows? If so, that can replace this function.
19 if (Deno.build.os == "windows") {
20 // if win32, prefix arguments with "/c {original command}"
21 // e.g. "mkdir c:\git\vimium" becomes "cmd.exe /c mkdir c:\git\vimium"
22 optArray.unshift("/c", procName);
23 procName = "cmd.exe";
24 }
25 const p = Deno.run({ cmd: [procName].concat(argsArray) });
26 const status = await p.status();
27 if (!status.success) {
28 throw new Error(`${procName} ${argsArray} exited with status ${status.code}`);
29 }
30}
31
32// Clones and augments the manifest.json that we use for Chrome with the keys needed for Firefox.
33function createFirefoxManifest(manifest) {

Callers 2

buildStorePackageFunction · 0.85
make.jsFile · 0.85

Calls 1

unshiftMethod · 0.45

Tested by

no test coverage detected