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" ) ;
44var 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
6161var opts = {
62- "cwd" : process . cwd ( )
62+ "cwd" : path . join ( process . cwd ( ) , "fs" )
6363} ;
6464if ( 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