reorder functions for no-use-before-define
This commit is contained in:
+15
-15
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user