Skip to content

Commit 113f6bd

Browse files
committed
fix(jsp): script root
1 parent 0ee3eb3 commit 113f6bd

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/create-jsp/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import chalk from 'chalk';
99

1010
import { recursiveCopySync } from './utils.js';
1111

12-
const SCRIPT_ROOT = getScriptRoot();
12+
const SCRIPT_ROOT = getScriptRoot(import.meta.url);
1313
const PACKAGE_MANAGER = getPackageManager();
1414

1515
const TEMPLATES_ROOT = join(SCRIPT_ROOT, '../src/templates');

packages/jsp/src/shell/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414

1515
import { build } from './build.js';
1616

17-
const SCRIPT_ROOT = getScriptRoot();
17+
const SCRIPT_ROOT = getScriptRoot(import.meta.url);
1818
const PACKAGE_JSON = getPackageJson(SCRIPT_ROOT);
1919

2020
/* */

packages/jsp/src/utils/script.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { dirname } from 'node:path';
22
import { fileURLToPath } from 'node:url';
33

4-
export const getScriptRoot = (): string => {
5-
return dirname(fileURLToPath(import.meta.url));
4+
export const getScriptRoot = (importMetaUrl: string): string => {
5+
return dirname(fileURLToPath(importMetaUrl));
66
};

0 commit comments

Comments
 (0)