Skip to content

Commit

Permalink
feat(config): remind user to restart ghost after making changes (#1382)
Browse files Browse the repository at this point in the history
  • Loading branch information
vikaspotluri123 authored Jan 28, 2021
1 parent 45a201e commit 5a7465c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/commands/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ class ConfigCommand extends Command {
// setter
this.instance.config.set(key, value).save();
this.ui.log(`Successfully set '${key}' to '${value}'`, 'green');

// If the instance is running, we want to remind the user to restart
// it so the new config can take effect. The isRunning check is only
// a nicety, so if it fails, swallow the error for better UX.
try {
if (await this.instance.isRunning()) {
const chalk = require('chalk');
this.ui.log(
`Ghost is running. Don't forget to run ${chalk.cyan('ghost restart')} to reload the config!`
);
}
} catch (_) {} // eslint-disable-line no-empty

return;
}

Expand Down

0 comments on commit 5a7465c

Please sign in to comment.