From 877b6bd838548b3fee497a4a9bf1917cdf594980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20Kurt=C3=A7u?= Date: Mon, 4 Dec 2023 22:34:00 +0300 Subject: [PATCH] feat: basedir option added to configuration for generate command --- actions/generate.action.ts | 5 +++++ lib/configuration/configuration.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/actions/generate.action.ts b/actions/generate.action.ts index 22c3ff012..33520eda5 100644 --- a/actions/generate.action.ts +++ b/actions/generate.action.ts @@ -1,4 +1,5 @@ import * as chalk from 'chalk'; +import * as path from 'path'; import { Answers } from 'inquirer'; import { Input } from '../commands'; import { getValueOrDefault } from '../lib/compiler/helpers/get-value-or-default'; @@ -125,6 +126,10 @@ const generateFiles = async (inputs: Input[]) => { } } + if (configuration.generateOptions?.baseDir) { + sourceRoot = path.join(sourceRoot, configuration.generateOptions.baseDir); + } + schematicOptions.push(new SchematicOption('sourceRoot', sourceRoot)); schematicOptions.push(new SchematicOption('spec', generateSpec)); schematicOptions.push(new SchematicOption('flat', generateFlat)); diff --git a/lib/configuration/configuration.ts b/lib/configuration/configuration.ts index af99cf1d4..3792ff331 100644 --- a/lib/configuration/configuration.ts +++ b/lib/configuration/configuration.ts @@ -77,6 +77,7 @@ export interface GenerateOptions { spec?: boolean | Record; flat?: boolean; specFileSuffix?: string; + baseDir?: string; } export interface ProjectConfiguration {