fix(Packaging): Ensure to show deprecation in all cases

This commit is contained in:
Mariusz Nowak 2021-10-18 13:46:36 +02:00 committed by Mariusz Nowak
parent 59f2d27166
commit cc71fc99ff

View File

@ -59,6 +59,13 @@ class AwsPackage {
this.hooks = {
'initialize': () => {
if (this.serverless.service.provider.disableDefaultOutputExportNames) {
this.serverless._logDeprecation(
'DISABLE_DEFAULT_OUTPUT_EXPORT_NAMES',
'Starting with `v3.0.0`, it will not be possible to disable default export names for outputs. To hide this deprecation message and ensure seamless upgrade, please remove this flag.'
);
}
if (this.serverless.processedInput.commands.join(' ') === 'package') {
log.notice();
log.notice(
@ -79,13 +86,6 @@ class AwsPackage {
},
'package:initialize': async () => {
if (this.serverless.service.provider.disableDefaultOutputExportNames) {
this.serverless._logDeprecation(
'DISABLE_DEFAULT_OUTPUT_EXPORT_NAMES',
'Starting with `v3.0.0`, it will not be possible to disable default export names for outputs. To hide this deprecation message and ensure seamless upgrade, please remove this flag.'
);
}
return this.generateCoreTemplate();
},