Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 4c229d2

Browse files
authored
build extension able to run on windows (#613)
1 parent 5a95b45 commit 4c229d2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cortex-js/package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
},
1010
"scripts": {
1111
"dev": "nest dev",
12-
"build": "yarn build:extensions && nest build && cp -r cpuinfo/bin ./dist/",
12+
"build": "yarn build:extensions && nest build && cpx \"cpuinfo/bin/**\" dist/bin",
1313
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
14-
"build:extensions": "for dir in ./src/extensions/*/; do (cd \"$dir\" && yarn && yarn build); done",
14+
"build:extensions": "run-script-os",
15+
"build:extensions:windows": "powershell -command \"$jobs = Get-ChildItem -Path './src/extensions' -Directory | ForEach-Object { Start-Job -Name ($_.Name) -ScriptBlock { param($_dir); try { Set-Location $_dir; yarn; yarn build; Write-Output 'Build successful in ' + $_dir } catch { Write-Error 'Error in ' + $_dir; throw } } -ArgumentList $_.FullName }; $jobs | Wait-Job; $jobs | ForEach-Object { Receive-Job -Job $_ -Keep } | ForEach-Object { Write-Host $_ }; $failed = $jobs | Where-Object { $_.State -ne 'Completed' -or $_.ChildJobs[0].JobStateInfo.State -ne 'Completed' }; if ($failed) { Exit 1 }\"",
16+
"build:extensions:linux": "for dir in ./src/extensions/*/; do (cd \"$dir\" && yarn && yarn build); done",
17+
"build:extensions:macos": "for dir in ./src/extensions/*/; do (cd \"$dir\" && yarn && yarn build); done",
1518
"start": "nest start",
1619
"start:dev": "nest start --watch",
1720
"start:debug": "nest start --debug --watch",
@@ -53,6 +56,7 @@
5356
"uuid": "^9.0.1"
5457
},
5558
"devDependencies": {
59+
"cpx": "^1.5.0",
5660
"@nestjs/cli": "^10.0.0",
5761
"@nestjs/schematics": "^10.0.0",
5862
"@nestjs/testing": "^10.0.0",
@@ -76,7 +80,8 @@
7680
"ts-jest": "^29.1.0",
7781
"ts-loader": "^9.4.3",
7882
"tsconfig-paths": "^4.2.0",
79-
"typescript": "^5.1.3"
83+
"typescript": "^5.1.3",
84+
"run-script-os": "^1.1.6"
8085
},
8186
"files": [
8287
"dist"

0 commit comments

Comments
 (0)