Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add messaging to use new package #420

Merged
merged 2 commits into from
Jan 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/cms-cli/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const yargs = require('yargs');
const updateNotifier = require('update-notifier');
const chalk = require('chalk');

const { logger } = require('@hubspot/cms-lib/logger');
const { logErrorInstance } = require('@hubspot/cms-lib/errorHandlers');
Expand All @@ -27,10 +28,15 @@ const listCommand = require('../commands/list');
const openCommand = require('../commands/open');
const mvCommand = require('../commands/mv');

const notifier = updateNotifier({ pkg });
const notifier = updateNotifier({ pkg: { ...pkg, name: '@hubspot/cli' } });

const CLI_UPGRADE_MESSAGE =
chalk.bold('The CMS CLI is now the HubSpot CLI') +
'\n\nTo upgrade, run:\n\nnpm uninstall -g @hubspot/cms-cli\nand npm install -g @hubspot/cli';

notifier.notify({
shouldNotifyInNpmScript: true,
message: pkg.name === '@hubspot/cms-cli' ? CLI_UPGRADE_MESSAGE : null,
});

const argv = yargs
Expand Down