Skip to content

Commit 72b461f

Browse files
acburdineErisDS
authored andcommitted
feat(update): add pre-stable warning message with docs link
closes #364 - if an instance was installed with a pre-stable version of Ghost-CLI, this message is output so that people know they need to do things to update their instance to work with the newest CLI version
1 parent bc845de commit 72b461f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/commands/update.js

+13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22
const fs = require('fs-extra');
33
const path = require('path');
4+
const chalk = require('chalk');
5+
const semver = require('semver');
46
const symlinkSync = require('symlink-or-copy').sync;
57

68
// Utils
@@ -19,6 +21,17 @@ class UpdateCommand extends Command {
1921
run(argv) {
2022
let instance = this.system.getInstance();
2123

24+
// If installed with a version < 1.0
25+
if (semver.lt(instance.cliConfig.get('cli-version'), '1.0.0')) {
26+
this.ui.log(
27+
`Ghost was installed with Ghost-CLI v${instance.cliConfig.get('cli-version')}, which is a pre-release version.\n` +
28+
'Your Ghost install is using out-of-date configuration & requires manual changes.\n' +
29+
`Please visit ${chalk.blue.underline('https://docs.ghost.org/docs/how-to-upgrade-ghost#section-upgrading-ghost-cli')}\n` +
30+
'for instructions on how to upgrade your instance.\n',
31+
'yellow'
32+
);
33+
}
34+
2235
let context = {
2336
instance: instance,
2437
force: argv.force,

0 commit comments

Comments
 (0)