@@ -14,7 +14,6 @@ import path from "path";
1414import os from "os" ;
1515import fs from "fs" ;
1616import * as dotenv from "dotenv" ;
17- import sh from "./sh.mjs" ;
1817import { getWorkspaceRoot , getWorkspacePackageJson } from "./workspace.mjs" ;
1918
2019import "zx/globals" ;
@@ -26,27 +25,23 @@ const emscripten = pkg.emscripten;
2625dotenv . config ( { path : "./.perspectiverc" , quiet : true } ) ;
2726
2827function base ( ) {
29- return sh . path ` ${ getWorkspaceRoot ( ) } / .emsdk` ;
28+ return path . resolve ( getWorkspaceRoot ( ) , " .emsdk" ) ;
3029}
3130
3231function emsdk_checkout ( ) {
33- function git ( args ) {
34- sh `git ${ args } ` . runSync ( ) ;
35- }
36-
37- git ( [ "clone" , "https://github.com/emscripten-core/emsdk.git" , base ( ) ] ) ;
32+ $ . sync `git clone https://github.com/emscripten-core/emsdk.git ${ base ( ) } ` ;
3833}
3934
4035function emsdk ( ...args ) {
4136 const basedir = base ( ) ;
4237 const suffix = os . type ( ) == "Windows_NT" ? ".bat" : "" ;
43- const emsdk = path . join ( basedir , "emsdk" + suffix ) ;
44- sh `${ emsdk } ${ args } ` . runSync ( ) ;
38+ const emsdkBin = path . join ( basedir , "emsdk" + suffix ) ;
39+ $ . sync `${ emsdkBin } ${ args } ` ;
4540}
4641
4742function toolchain_install ( ) {
4843 console . log ( `-- Installing Emscripten ${ emscripten } ` ) ;
49- sh `git pull` . cwd ( ".emsdk" ) . runSync ( ) ;
44+ $ . sync ( { cwd : ".emsdk" } ) `git pull` ;
5045 emsdk ( "install" , emscripten ) ;
5146 emsdk ( "activate" , emscripten ) ;
5247 console . log ( `-- Emscripten ${ emscripten } installed` ) ;
@@ -68,5 +63,4 @@ if (!process.env.PSP_SKIP_EMSDK_INSTALL) {
6863 }
6964
7065 toolchain_install ( ) ;
71- $ . sync `cd .emsdk && git apply ../tools/scripts/emsdk.patch` ;
7266}
0 commit comments