Skip to content

Commit 411654c

Browse files
committed
Fix issues on Windows
1 parent ac286a9 commit 411654c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/buildtools/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pathlib from 'path';
77
import getBuildCommand from '@sourceacademy/modules-repotools/builder';
88

9-
const repoRoot = pathlib.resolve(import.meta.dirname, '../..');
9+
const repoRoot = pathlib.resolve(pathlib.dirname(import.meta.dirname), '..', '..');
1010

1111
const command = getBuildCommand({
1212
entryPoints: ['./src/commands/index.ts'],
@@ -35,7 +35,7 @@ const command = getBuildCommand({
3535
const newDirectory = pathlib.relative('./bin', repoRoot);
3636
return {
3737
external: true,
38-
path: pathlib.posix.join(newDirectory, base),
38+
path: pathlib.join(newDirectory, base),
3939
};
4040
});
4141
}

lib/repotools/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export async function isBundleOrTabDirectory(directory: string) {
108108

109109
async function recurser(directory: string): Promise<['bundle' | 'tab', string] | null> {
110110
try {
111-
const packageJson = JSON.parse(await fs.readFile(`${directory}/package.json`, 'utf-8'));
111+
const packageJson = JSON.parse(await fs.readFile(pathlib.join(directory, 'package.json'), 'utf-8'));
112112
const match = RE.exec(packageJson.name);
113113

114114
if (match) {

0 commit comments

Comments
 (0)