Skip to content

Commit

Permalink
output-folder could be either relative path or absolute path (#1378)
Browse files Browse the repository at this point in the history
  • Loading branch information
dolauli committed Sep 24, 2024
1 parent ce0daf5 commit 694cced
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions powershell/utils/tsp-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ import { TspHostImpl } from './tsp-host';
import { stat } from 'fs';
import { serialize } from '@azure-tools/codegen';
import { clearFolder, resolveUri, createFolderUri } from '@azure-tools/uri';
import { join, resolve as currentDirectory } from 'path';
import { join, resolve as currentDirectory, isAbsolute } from 'path';

async function clearOutputFiles(state: ModelState<PwshModel>) {
if (await state.getValue('clear-output-folder', false)) {
const outputFolder = createFolderUri(join(currentDirectory(), await state.getValue('output-folder', './generated')));
const outputFolderConfig = await state.getValue('output-folder', './generated');
const outputFolder = createFolderUri(isAbsolute(outputFolderConfig) ? outputFolderConfig : join(currentDirectory(), outputFolderConfig));
const psd1: string = await state.getValue('psd1');
const customFolder: string = await state.getValue('custom-cmdlet-folder');
const testFolder: string = await state.getValue('test-folder');
Expand Down

0 comments on commit 694cced

Please sign in to comment.