sudo(command, options = {}) {
        this.log(`+ sudo ${command}`, 'gray');

        const prompt = '#node-sudo-passwd#';
        const cmd = command.replace(/^ghost/, process.argv.slice(0, 2).join(' '));
        const cp = execa.shell(`sudo -S -p '${prompt}' ${options.sudoArgs || ''} ${cmd}`, omit(options, ['sudoArgs']));

        cp.stderr.on('data', (data) => {
            const lines = data.toString('utf8').split('\n');

            /* istanbul ignore else */
            // If sudo has prompted for a password, then it will be the last line output
            if (lines[lines.length - 1] === prompt) {
                this.prompt({
                    type: 'password',
                    name: 'password',
                    message: 'Sudo Password'
                }).then((answers) => {
                    cp.stdin.write(`${answers.password}\n`);
                });
            }
        });

        return cp;
    }
Runs a sudo command on the system. Outputs the command
that it's running.

Code inspired by https://github.com/calmh/node-sudo/blob/master/lib/sudo.js

@param {string} command Command to run
@param {Object} options Options to pass to execa
@return Promise<Object> Result of execa command

@method sudo
@public