mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
refactor: Automatically align multiline deprecations
This commit is contained in:
parent
246e4a6756
commit
9cb86a4af2
@ -25,6 +25,13 @@ const resolveDeprecatedByService = weakMemoizee(serviceConfig => {
|
||||
});
|
||||
|
||||
function writeDeprecation(code, message) {
|
||||
const prefix = 'Serverless: ';
|
||||
const messageLines = message.split('\n');
|
||||
const followingLinesPrefix = ' '.repeat(prefix.length);
|
||||
for (let i = 1; i < messageLines.length; ++i) {
|
||||
messageLines[i] = followingLinesPrefix + messageLines[i];
|
||||
}
|
||||
message = messageLines.join('\n');
|
||||
process.stdout.write(
|
||||
`Serverless: ${chalk.keyword('orange')(`Deprecation warning: ${message}`)}\n`
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user