Skip to content

Commit 6f057d5

Browse files
committed
MacOS fixes
1 parent 4a42721 commit 6f057d5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "qemu-bridge",
3-
"version": "0.0.1",
4-
"description": "Bridge to use host's QEMU inside CatCore as an app. ",
3+
"version": "0.0.2",
4+
"description": "Bridge to use host's QEMU inside CatCore as an app.",
55
"main": "src/index.js",
66
"scripts": {
77
"build": "node app-compiler/src/index.js build.js",

src/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Modules (this requires kernel permissions!)
2-
var fs = require("fs");
3-
var path = require("path");
2+
var fs = require("node:fs");
3+
var path = require("node:path");
44
var child_process = require("node:child_process");
55

66
// Get arguments and current executable filename
@@ -24,7 +24,7 @@ for (var argIndex = 0; argIndex < args.length; argIndex++) {
2424
if (!await CatCore.FS.exists(fsPath)) {
2525
throw `${bin}: ${arg} ${fsPath}: Could not open '${fsPath}': File does not exist.`;
2626
}
27-
args2.push(`.\\fs${fsPath.split("/").join("\\")}`);
27+
args2.push(CatCore.FS.normalizePath(fsPath).slice(1));
2828
argIndex++;
2929
}
3030
// Parse paths in -drive
@@ -36,7 +36,7 @@ for (var argIndex = 0; argIndex < args.length; argIndex++) {
3636
if (!await CatCore.FS.exists(fsPath)) {
3737
throw `${bin}: ${arg} ${fsPath}: Could not open '${fsPath}': File does not exist.`;
3838
}
39-
driveArgs = driveArgs.replace(fsPath, `.\\fs${fsPath.split("/").join("\\")}`);
39+
driveArgs = driveArgs.replace(fsPath, CatCore.FS.normalizePath(fsPath).slice(1));
4040
args2.push(driveArgs);
4141
argIndex++;
4242
}
@@ -59,10 +59,10 @@ if (!await CatCore.FS.exists("/data/qemu.png", true)) {
5959
}
6060

6161
var opts = {
62-
"cwd": process.cwd()
62+
"cwd": path.join(process.cwd(), "fs")
6363
};
6464
if (process.platform == "darwin") {
65-
opts.cwd = path.join(process.cwd(), "..", "..", "..", "..");
65+
opts.cwd = path.join(process.cwd(), "..", "..", "..", "..", "fs");
6666
}
6767

6868
// Start QEMU process on the host

0 commit comments

Comments
 (0)