reorder functions for no-use-before-define

This commit is contained in:
Girish Ramakrishnan
2026-02-14 16:34:34 +01:00
parent 36aa641cb9
commit e9f96593c3
31 changed files with 2621 additions and 2648 deletions
+15 -15
View File
@@ -8,21 +8,6 @@ import _ from './underscore.js';
const debug = debugModule('box:shell');
export default shell;
function shell(tag) {
assert.strictEqual(typeof tag, 'string');
return {
bash: bash.bind(null, tag),
spawn: spawn.bind(null, tag),
sudo: sudo.bind(null, tag),
};
}
const SUDO = '/usr/bin/sudo';
const KILL_CHILD_CMD = path.join(import.meta.dirname, 'scripts/kill-child.sh');
function lineCount(buffer) {
assert(Buffer.isBuffer(buffer));
@@ -36,6 +21,9 @@ function lineCount(buffer) {
return count;
}
const SUDO = '/usr/bin/sudo';
const KILL_CHILD_CMD = path.join(import.meta.dirname, 'scripts/kill-child.sh');
function spawn(tag, file, args, options) {
assert.strictEqual(typeof tag, 'string');
assert.strictEqual(typeof file, 'string');
@@ -159,3 +147,15 @@ async function sudo(tag, args, options) {
const spawnArgs = [ ...sudoArgs, ...args ];
return await spawn(tag, SUDO, spawnArgs, options);
}
function shell(tag) {
assert.strictEqual(typeof tag, 'string');
return {
bash: bash.bind(null, tag),
spawn: spawn.bind(null, tag),
sudo: sudo.bind(null, tag),
};
}
export default shell;