mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
refactor(CLI Onboarding): Support future object notation for console
This commit is contained in:
parent
f0bff7463c
commit
2f187a52eb
@ -14,7 +14,7 @@ const yamlExtensions = new Set(['.yml', '.yaml']);
|
||||
|
||||
const appPattern = /^(?:#\s*)?app\s*:.+/m;
|
||||
const orgPattern = /^(?:#\s*)?org\s*:.+/m;
|
||||
const consolePattern = /^(?:#\s*)?console\s*:.+/m;
|
||||
const consolePattern = /^(?:#\s*)?console\s*:(.*)/m;
|
||||
|
||||
const ServerlessError = require('../../serverless-error');
|
||||
const resolveStage = require('../../utils/resolve-stage');
|
||||
@ -93,7 +93,10 @@ module.exports = {
|
||||
if (isConsole) {
|
||||
const consoleMatch = ymlString.match(consolePattern);
|
||||
if (consoleMatch) {
|
||||
ymlString = ymlString.replace(consoleMatch[0], 'console: true');
|
||||
ymlString = ymlString.replace(
|
||||
consoleMatch[0],
|
||||
`console:${consoleMatch[1].trim() ? ' true' : ''}`
|
||||
);
|
||||
} else {
|
||||
ymlString = `console: true\n${ymlString}`;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user