1
1
import { $ } from "bun" ;
2
- import { existsSync , mkdirSync , readFileSync , rmdirSync } from "node:fs" ;
3
- import { resolve , normalize , join , dirname } from "node:path" ;
2
+ import { existsSync , mkdirSync , rmdirSync , readFileSync } from "node:fs" ;
3
+ import { dirname , join , normalize , resolve } from "node:path" ;
4
4
5
5
/// The type returned from the `cargo-msfs info -f` command
6
6
interface InstalledSdkVersions {
@@ -18,8 +18,10 @@ function findWorkspaceRoot() {
18
18
do {
19
19
// Try reading a package.json in this directory
20
20
const packageJson = join ( current , "package.json" ) ;
21
+
21
22
if ( existsSync ( packageJson ) ) {
22
- const manifest = JSON . parse ( readFileSync ( packageJson , "utf8" ) ) ;
23
+ const manifest = JSON . parse ( readFileSync ( packageJson , "utf-8" ) ) as { workspaces ?: string [ ] } ;
24
+
23
25
// Check if there is workspaces, meaning this is root
24
26
if ( manifest . workspaces ) {
25
27
return current ;
@@ -101,7 +103,7 @@ async function main() {
101
103
-w /workspace${ relativeWorkdDir } \
102
104
${ IMAGE_NAME } \
103
105
bash -c "cargo-msfs build ${ version } -i ./src/wasm -o ./${ relativeSimDir } /msfs_navigation_data_interface.wasm"` . catch (
104
- err => process . exit ( err . exitCode ?? 1 ) ,
106
+ ( err : { exitCode ?: number } ) => process . exit ( err . exitCode ?? 1 ) ,
105
107
) ;
106
108
}
107
109
}
0 commit comments