which(command) { return new Promise(resolve => which(command, (error, resolvedPath) => resolve({ resolvedPath: resolvedPath, error: error ? error.message : null }))); }
let settings = require(settingsFile); signale.pending(`Resolving shell path...`); settings.shell = await which(settings.shell).catch(e => { throw(e) }); signale.info(`Shell found at ${settings.shell}`); signale.success(`Settings loaded!`);
which('git', (e, git) => { if (e) return reject(e) const args = prefix.concat(cmds) execFile(git, args, opt, (e, stdout) => { if (e) return reject(e) resolve(stdout) }) })
t.test('npm doctor ping returns 404 (or any other error)', function (t) { npm.commands.doctor({ 'node-url': node_url }, true, function (e, list) { t.ifError(e, 'npm loaded successfully') t.same(list.length, 9, 'list should have 9 prop') t.same(list[0][1], 'failed', 'npm ping') t.same(list[1][1], 'v' + npm.version, 'npm -v') t.same(list[2][1], process.version, 'node -v') t.same(list[3][1], common.registry + '/', 'npm config get registry') t.same(list[5][1], 'ok', 'Perms check on cached files') t.same(list[6][1], 'ok', 'Perms check on global node_modules') t.same(list[7][1], 'ok', 'Perms check on local node_modules') t.match(list[8][1], /^verified \d+ tarballs?$/, 'Cache verified') which('git', function (e, resolvedPath) { t.ifError(e, 'git command is installed') t.same(list[4][1], resolvedPath, 'which git') t.done() }) }) })
async function getBinaryPath({ execPath }) { const path = execPath || binPath return path ? path : binPath = await which('tesseract') }
which(command, function (err, execPath) { if (err) {
let settings = require(settingsFile); signale.pending(`Resolving shell path...`); settings.shell = await which(settings.shell).catch(e => { throw(e) }); signale.info(`Shell found at ${settings.shell}`); signale.success(`Settings loaded!`);