Skip to content

Commit e8107af

Browse files
committed
fix(run): skip dir warning if env var is set
1 parent c4200bc commit e8107af

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/apiProject.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as url from 'url';
44
import Helpers from 'handlebars-helpers';
55
import type { HelperDelegate } from 'handlebars';
66
import type { NodePlopAPI } from 'plop';
7+
import type { PromptQuestion } from 'node-plop';
78

89
import { Prompts } from './prompts.js';
910
import type { OtiAnswers } from './prompts.js';
@@ -38,12 +39,12 @@ export default function (plop: NodePlopAPI) {
3839
plop.setGenerator('api', {
3940
description: 'Generate an API service',
4041
prompts: [
41-
Prompts.dirWarning,
42+
process.env.NO_DIR_WARNING ? undefined : Prompts.dirWarning,
4243
Prompts.email, Prompts.fullname, Prompts.org,
4344
Prompts.name, Prompts.desc,
4445
Prompts.features,
4546
Prompts.dbName,
46-
],
47+
].filter((p) => !!p) as PromptQuestion[],
4748
actions(data) {
4849
return [
4950
{

0 commit comments

Comments
 (0)