Skip to content

Commit 288d07a

Browse files
committed
fix(scripts): use process.cwd() instead of __dirname
1 parent 8a38fe6 commit 288d07a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/pre-gen/setHostsOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type AdditionalProperties = Partial<{
3232
}>;
3333

3434
async function setHostsOptions(): Promise<void> {
35-
const openapitoolsPath = path.join(__dirname, '../../openapitools.json');
35+
const openapitoolsPath = path.join(process.cwd(), '../openapitools.json');
3636
const openapitools = JSON.parse(await readFile(openapitoolsPath, 'utf-8'));
3737

3838
const [language, client] = process.argv.slice(2);
@@ -43,7 +43,7 @@ async function setHostsOptions(): Promise<void> {
4343
throw new Error(`Generator not found: ${generator}`);
4444
}
4545

46-
const specPath = path.join(__dirname, `../../specs/bundled/${client}.yml`);
46+
const specPath = path.join(process.cwd(), `../specs/bundled/${client}.yml`);
4747

4848
if (!(await stat(specPath))) {
4949
throw new Error(`File not found ${specPath}`);

0 commit comments

Comments
 (0)