<commit_before>'use strict';
const Command = require('../command');
const StartCommand = require('./start');
const StopCommand = require('./stop');

class RestartCommand extends Command {
    run(argv) {
        let instance = this.system.getInstance();

        if (!instance.running) {
            return Promise.reject(new Error('Ghost instance is not currently running.'));
        }

        instance.loadRunningConfig(true, true);

        return this.runCommand(StartCommand, argv).then(() => this.runCommand(StopCommand, argv));
    }
}

RestartCommand.description = 'Restart the ghost instance';
module.exports = RestartCommand;<commit_msg>fix(restart): make restart command be less stupid<commit_after>'use strict';
const Command = require('../command');
const StartCommand = require('./start');
const StopCommand = require('./stop');

class RestartCommand extends Command {
    run(argv) {
        let instance = this.system.getInstance();

        if (!instance.running) {
            return Promise.reject(new Error('Ghost instance is not currently running.'));
        }

        instance.loadRunningConfig(true, true);

        return this.runCommand(StopCommand, argv).then(() => this.runCommand(StartCommand, argv));
    }
}

RestartCommand.description = 'Restart the ghost instance';
module.exports = RestartCommand;
{'fraction_non_alphanumeric': 0.13268365817091454, 'fraction_numerical': 0.0, 'mean_word_length': 3.717314487632509, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '202434', 'n_tokens_mistral': 343, 'n_tokens_neox': 335, 'n_words': 91}