mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
Reorganize logic
This commit is contained in:
parent
af3ac05342
commit
6df0f6872f
@ -34,16 +34,7 @@ module.exports = path => {
|
||||
{ name: 'Other', value: 'other' },
|
||||
],
|
||||
})
|
||||
.then(({ projectType }) => {
|
||||
if (projectType === 'other') {
|
||||
process.stdout.write(
|
||||
'\nRun “serverless create --help” to view available templates and create a new project ' +
|
||||
'from one of those templates.\n\n'
|
||||
);
|
||||
return null;
|
||||
}
|
||||
return projectType;
|
||||
});
|
||||
.then(({ projectType }) => projectType);
|
||||
|
||||
const projectNameInput = () =>
|
||||
inquirer
|
||||
@ -132,7 +123,13 @@ module.exports = path => {
|
||||
if (!createWanted) return null;
|
||||
|
||||
return projectTypeChoice().then(projectType => {
|
||||
if (!projectType) return null;
|
||||
if (projectType === 'other') {
|
||||
process.stdout.write(
|
||||
'\nRun “serverless create --help” to view available templates and create a new project ' +
|
||||
'from one of those templates.\n\n'
|
||||
);
|
||||
return null;
|
||||
}
|
||||
return projectNameInput()
|
||||
.then(projectName => {
|
||||
const projectDir = join(process.cwd(), projectName);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user