@@ -14,8 +14,8 @@ use std::{
1414} ;
1515
1616use anyhow:: Context ;
17- use common:: sha256:: Sha256 ;
1817use serde:: Deserialize ;
18+ use value:: sha256:: Sha256 ;
1919
2020const PACKAGES_DIR : & str = "../../npm-packages" ;
2121const NPM_DIR : & str = "../../npm-packages/convex" ;
@@ -26,6 +26,16 @@ const NODE_EXECUTOR_DIST_DIR: &str = "../../npm-packages/node-executor/dist";
2626
2727const ADMIN_KEY : & str = include_str ! ( "../keybroker/dev/admin_key.txt" ) ;
2828
29+ #[ cfg( not( target_os = "windows" ) ) ]
30+ const RUSH : & str = "../scripts/node_modules/.bin/rush" ;
31+ #[ cfg( target_os = "windows" ) ]
32+ const RUSH : & str = "../../scripts/node_modules/.bin/rush.cmd" ;
33+ #[ cfg( not( target_os = "windows" ) ) ]
34+ const NPM : & str = "npm" ;
35+ #[ cfg( target_os = "windows" ) ]
36+ const NPM : & str = "npm.cmd" ;
37+ const CONVEX : & str = "node_modules/convex/bin/main.js" ;
38+
2939#[ derive( Debug , Deserialize ) ]
3040#[ serde( rename_all = "camelCase" ) ]
3141struct Bundle {
@@ -109,8 +119,8 @@ fn main() -> anyhow::Result<()> {
109119
110120 // Step 1: Ensure the `server`, `dashboard`, and `cli` deps are installed.
111121 for _ in 0 ..3 {
112- let output = Command :: new ( "../scripts/node_modules/.bin/rush" )
113- . current_dir ( PACKAGES_DIR )
122+ let output = Command :: new ( RUSH )
123+ . current_dir ( Path :: new ( PACKAGES_DIR ) )
114124 . args ( [ "install" ] )
115125 . output ( )
116126 . context ( "Failed on rush install" ) ?;
@@ -127,7 +137,7 @@ fn main() -> anyhow::Result<()> {
127137 anyhow:: ensure!( output. status. success( ) , "Failed to 'rush install'" ) ;
128138 break ;
129139 }
130- let status = Command :: new ( "../scripts/node_modules/.bin/rush" )
140+ let status = Command :: new ( RUSH )
131141 . current_dir ( PACKAGES_DIR )
132142 . args ( [
133143 "build" ,
@@ -144,7 +154,7 @@ fn main() -> anyhow::Result<()> {
144154 . context ( "Failed on rush build" ) ?;
145155 anyhow:: ensure!( status. success( ) , "Failed to 'rush build'" ) ;
146156 // Step 2: Use `build-server` to package up our builtin `_system` UDFs.
147- let output = Command :: new ( "npm" )
157+ let output = Command :: new ( NPM )
148158 . current_dir ( NPM_DIR )
149159 . arg ( "run" )
150160 . arg ( "--silent" )
@@ -202,10 +212,10 @@ fn write_udf_test_bundle(out_dir: &Path) -> anyhow::Result<()> {
202212 if Path :: exists ( & bundle_dir) {
203213 fs:: remove_dir_all ( bundle_dir. clone ( ) ) ?;
204214 }
205- let output = Command :: new ( "npx " )
215+ let output = Command :: new ( "node " )
206216 . current_dir ( UDF_TESTS_DIR )
207217 . args ( [
208- "convex" ,
218+ CONVEX ,
209219 "deploy" ,
210220 "--debug-bundle-path" ,
211221 bundle_dir. to_str ( ) . unwrap ( ) ,
0 commit comments