PATH:
usr
/
local
/
lib
/
node_modules
/
ghost-cli
/
lib
/
commands
const Command = require('../command'); class StopCommand extends Command { static configureOptions(commandName, yargs, extensions) { const get = require('lodash/get'); const omit = require('lodash/omit'); extensions.forEach((extension) => { const options = get(extension, 'config.options.stop', false); if (!options) { return; } Object.assign(this.options, omit(options, Object.keys(this.options))); }); yargs = super.configureOptions(commandName, yargs, extensions); return yargs; } async run(argv) { const {SystemError} = require('../errors'); const checkValidInstall = require('../utils/check-valid-install'); const runOptions = {quiet: argv.quiet}; if (argv.all) { return this.stopAll(); } if (!argv.name) { checkValidInstall('stop'); } const instance = this.system.getInstance(argv.name); if (argv.name && !instance) { throw new SystemError(`Ghost instance '${argv.name}' does not exist`); } const isRunning = await instance.isRunning(); if (!isRunning) { this.ui.log('Ghost is already stopped! For more information, run', 'ghost ls', 'green', 'cmd', true); return; } await this.ui.run(() => instance.stop(argv.disable), `Stopping Ghost: ${instance.name}`, runOptions); } async stopAll() { const Promise = require('bluebird'); const instances = this.system.getAllInstances(true); await Promise.each(instances, async ({name}) => { await this.ui.run(() => this.run({quiet: true, name}), `Stopping Ghost: ${name}`); }); } } StopCommand.description = 'Stops an instance of Ghost'; StopCommand.params = '[name]'; StopCommand.options = { all: { alias: 'a', description: 'option to stop all running Ghost blogs', type: 'boolean' }, disable: { description: 'Disable restarting Ghost on server reboot (if the process manager supports it)', type: 'boolean' } }; StopCommand.global = true; module.exports = StopCommand;
[-] stop.js
[edit]
[-] migrate.js
[edit]
[-] restart.js
[edit]
[+]
..
[-] run.js
[edit]
[-] import.js
[edit]
[-] install.js
[edit]
[-] export.js
[edit]
[-] uninstall.js
[edit]
[+]
doctor
[-] check-update.js
[edit]
[-] start.js
[edit]
[-] config.js
[edit]
[-] update.js
[edit]
[-] ls.js
[edit]
[-] setup.js
[edit]
[-] buster.js
[edit]
[-] log.js
[edit]
[-] version.js
[edit]