MCPcopy
hub / github.com/mruniquehacker/Knightbot-MD / run

Function run

commands/update.js:8–15  ·  view source on GitHub ↗
(cmd)

Source from the content-addressed store, hash-verified

6const isOwnerOrSudo = require('../lib/isOwner');
7
8function run(cmd) {
9 return new Promise((resolve, reject) => {
10 exec(cmd, { windowsHide: true }, (err, stdout, stderr) => {
11 if (err) return reject(new Error((stderr || stdout || err.message || '').toString()));
12 resolve((stdout || '').toString());
13 });
14 });
15}
16
17async function hasGitRepo() {
18 const gitDir = path.join(process.cwd(), '.git');

Callers 5

hasGitRepoFunction · 0.85
updateViaGitFunction · 0.85
extractZipFunction · 0.85
restartProcessFunction · 0.85
updateCommandFunction · 0.85

Calls 1

execFunction · 0.85

Tested by

no test coverage detected