Skip to content

Commit

Permalink
Merge pull request #2415 from yigitkurtcu/feat/generate-options-base-url
Browse files Browse the repository at this point in the history
feat: basedir option added to configuration for generate command
  • Loading branch information
kamilmysliwiec authored Oct 21, 2024
2 parents ef0ff51 + 877b6bd commit 537dfa7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions actions/generate.action.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions lib/configuration/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export interface GenerateOptions {
spec?: boolean | Record<string, boolean>;
flat?: boolean;
specFileSuffix?: string;
baseDir?: string;
}

export interface ProjectConfiguration {
Expand Down

0 comments on commit 537dfa7

Please sign in to comment.