mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
'use strict';
|
|
|
|
const cliProgressFooter = require('cli-progress-footer');
|
|
const chalk = require('chalk');
|
|
|
|
class InteractiveDeployProgress {
|
|
constructor(serverless) {
|
|
this.serverless = serverless;
|
|
this.progress = cliProgressFooter({ overrideStdout: false });
|
|
this.progress.shouldAddProgressAnimationPrefix = true;
|
|
|
|
this.hooks = {
|
|
'before:deploy:deploy': async () => {
|
|
this.progress.updateProgress('Deploying your project. This might take a few minutes...\n');
|
|
},
|
|
'deploy:finalize': async () => {
|
|
this.progress.updateProgress('');
|
|
this.progress.writeStdout(chalk.green('\nDeployment succesful\n'));
|
|
},
|
|
|
|
'package:initialize': async () => {
|
|
this.progress.updateProgress('Packaging your project...\n');
|
|
},
|
|
'package:finalize': async () => {
|
|
this.progress.updateProgress('');
|
|
this.progress.writeStdout(chalk.green('\nPackaging succesful\n'));
|
|
},
|
|
};
|
|
}
|
|
|
|
handleError() {
|
|
this.progress.updateProgress('');
|
|
}
|
|
}
|
|
|
|
module.exports = InteractiveDeployProgress;
|