Skip to content

Commit

Permalink
refactor(CLI): Ensure empty line prior final status with progress
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Oct 7, 2021
1 parent 8184c01 commit c9f2227
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions commands/plugin-install.js
Expand Up @@ -38,6 +38,7 @@ module.exports = async ({ configuration, serviceDir, configurationFilename, opti
await addPluginToServerlessFile(context);

legacy.log(`Successfully installed "${pluginName}@${pluginVersion}"`);
log.notice();
log.notice.success(
`Plugin "${pluginName}${
pluginVersion === 'latest' ? '' : `@${pluginVersion}`
Expand Down Expand Up @@ -138,6 +139,7 @@ const requestManualUpdate = (configurationFilePath) => {
Can't automatically add plugin into "${path.basename(configurationFilePath)}" file.
Please make it manually.
`);
log.notice();
log.notice.skip(
`Can't automatically add plugin into "${path.basename(
configurationFilePath
Expand Down
2 changes: 2 additions & 0 deletions commands/plugin-uninstall.js
Expand Up @@ -33,6 +33,7 @@ module.exports = async ({ configuration, serviceDir, configurationFilename, opti
await removePluginFromServerlessFile(context);

legacy.log(`Successfully uninstalled "${pluginName}"`);
log.notice();
log.notice.success(
`Plugin "${pluginName}" uninstalled ${style.aside(
`(${Math.floor((Date.now() - commandRunStartTime) / 1000)}s)`
Expand Down Expand Up @@ -118,6 +119,7 @@ const requestManualUpdate = (configurationFilePath) => {
Can't automatically remove plugin from "${path.basename(configurationFilePath)}" file.
Please do it manually.
`);
log.notice();
log.notice.skip(
`Can't automatically remove plugin from "${path.basename(
configurationFilePath
Expand Down
1 change: 1 addition & 0 deletions lib/plugins/install.js
Expand Up @@ -37,6 +37,7 @@ class Install {
].join('');

legacy.log(message);
log.notice();
log.notice.success(
`${message} ${style.aside(`(${Math.floor((Date.now() - commandRunStartTime) / 1000)}s)`)}`
);
Expand Down
2 changes: 2 additions & 0 deletions lib/plugins/plugin/install.js
Expand Up @@ -26,6 +26,7 @@ const requestManualUpdate = (serverlessFilePath) => {
Can't automatically add plugin into "${path.basename(serverlessFilePath)}" file.
Please make it manually.
`);
log.notice();
log.notice.skip(
`Can't automatically add plugin into "${path.basename(
serverlessFilePath
Expand Down Expand Up @@ -77,6 +78,7 @@ class PluginInstall {
` "${this.options.pluginName}@${this.options.pluginVersion}"`,
].join('');
legacy.log(message);
log.notice();
log.notice.success(
`Plugin "${this.options.pluginName}${
this.options.pluginVersion === 'latest' ? '' : `@${this.options.pluginVersion}`
Expand Down
2 changes: 2 additions & 0 deletions lib/plugins/plugin/uninstall.js
Expand Up @@ -23,6 +23,7 @@ const requestManualUpdate = (serverlessFilePath) => {
Can't automatically remove plugin from "${path.basename(serverlessFilePath)}" file.
Please make it manually.
`);
log.notice();
log.notice.skip(
`Can't automatically remove plugin from "${path.basename(
serverlessFilePath
Expand Down Expand Up @@ -70,6 +71,7 @@ class PluginUninstall {
.then(this.removePluginFromServerlessFile)
.then(() => {
legacy.log(`Successfully uninstalled "${this.options.pluginName}"`);
log.notice();
log.notice.success(
`Plugin "${this.options.pluginName}" uninstalled ${style.aside(
`(${Math.floor(
Expand Down
3 changes: 3 additions & 0 deletions lib/plugins/standalone.js
Expand Up @@ -47,6 +47,7 @@ module.exports = class Standalone {
const latestVersion = tagName.slice(1);
if (latestVersion === currentVersion) {
legacy.log('Already at latest version');
log.notice();
log.notice.skip(
`Already at latest version ${style.aside(
`(${Math.floor(
Expand Down Expand Up @@ -88,6 +89,7 @@ module.exports = class Standalone {
await fsp.rename(BINARY_TMP_PATH, BINARY_PATH);
await fsp.chmod(BINARY_PATH, 0o755);
legacy.log(`Successfully upgraded to ${tagName}`);
log.notice();
log.notice.success(
`Successfully upgraded to ${tagName} ${style.aside(
`(${Math.floor((Date.now() - this.serverless.pluginManager.commandRunStartTime) / 1000)}s)`
Expand All @@ -99,6 +101,7 @@ module.exports = class Standalone {
mainProgress.notice('Uninstalling standalone binary', { isMainEvent: true });
await fse.remove(path.dirname(BINARY_PATH));
legacy.log('Uninstalled');
log.notice();
log.notice.success(
`Standalone binary uninstalled ${style.aside(
`(${Math.floor((Date.now() - this.serverless.pluginManager.commandRunStartTime) / 1000)}s)`
Expand Down

0 comments on commit c9f2227

Please sign in to comment.