Skip to content

Commit

Permalink
feat: basedir option added to configuration for generate command
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitkurtcu committed May 26, 2024
1 parent 77c3e45 commit 877b6bd
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 877b6bd

Please sign in to comment.