@jacebenson/jsn 5.5.2-dev.173.1 → 5.5.2-dev.175.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/upgrade.js +3 -3
package/package.json
CHANGED
package/src/commands/upgrade.js
CHANGED
|
@@ -43,12 +43,12 @@ export function upgradeCmd(wrap, { version = getVersion, check = checkLatest, in
|
|
|
43
43
|
aliases: ['update'],
|
|
44
44
|
describe: 'Upgrade jsn through npm (preserves the installed release channel)',
|
|
45
45
|
builder: (y) => y
|
|
46
|
-
.option('channel', { type: 'string', choices: ['dev', 'latest'], describe: 'Choose
|
|
46
|
+
.option('channel', { type: 'string', choices: ['dev', 'main', 'latest'], describe: 'Choose dev or stable (main/latest)' })
|
|
47
47
|
.option('dry-run', { type: 'boolean', describe: 'Show the install command without installing' })
|
|
48
48
|
.option('force', { type: 'boolean', describe: 'Reinstall even when the selected version is not newer' }),
|
|
49
49
|
handler: wrap(async (argv, app) => {
|
|
50
50
|
const current = version();
|
|
51
|
-
const channel = argv.channel || getReleaseChannel(current);
|
|
51
|
+
const channel = argv.channel === 'main' ? 'latest' : argv.channel || getReleaseChannel(current);
|
|
52
52
|
const args = ['install', '-g', `@jacebenson/jsn@${channel}`];
|
|
53
53
|
const command = `npm ${args.join(' ')}`;
|
|
54
54
|
if (argv.dryRun || argv['dry-run']) {
|
|
@@ -56,7 +56,7 @@ export function upgradeCmd(wrap, { version = getVersion, check = checkLatest, in
|
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
const latest = await check({ version: current, channel });
|
|
59
|
-
if (!latest) throw new AppError(CodeNetwork, 'Could not check the npm release channel.',
|
|
59
|
+
if (!latest) throw new AppError(CodeNetwork, 'Could not check the npm release channel.', `Check connectivity and retry, or install manually: ${command}`);
|
|
60
60
|
const switching = argv.channel && channel !== getReleaseChannel(current);
|
|
61
61
|
if (!argv.force && !switching && !isNewer(latest, current)) {
|
|
62
62
|
app.ok({ version: current, latest, channel, upToDate: true }, { summary: `jsn ${current} — no newer version available` });
|