@@ -11546,7 +11546,7 @@ function oneLine(message) {
1154611546
1154711547// src/blockbench.ts
1154811548var delay = ( ms ) => new Promise ( ( resolve2 ) => setTimeout ( resolve2 , ms ) ) ;
11549- var ENVIRONMENT = "animated-java-ci" ;
11549+ var DEFAULT_ENVIRONMENT = "animated-java-ci" ;
1155011550function getFreePort ( ) {
1155111551 return new Promise ( ( resolve2 , reject ) => {
1155211552 const server = ( 0 , import_node_net . createServer ) ( ) ;
@@ -11567,12 +11567,12 @@ function numericSemver(a, b2) {
1156711567 }
1156811568 return 0 ;
1156911569}
11570- async function ensurePortable ( eb , blockbenchVersion ) {
11571- if ( await eb . environmentExists ( ENVIRONMENT ) !== "env" ) {
11570+ async function ensurePortable ( eb , environment , blockbenchVersion ) {
11571+ if ( await eb . environmentExists ( environment ) !== "env" ) {
1157211572 info ( `Provisioning Blockbench (${ blockbenchVersion } ) via envbench...` ) ;
1157311573 let lastPercent = - 1 ;
1157411574 await eb . createEnvironment (
11575- ENVIRONMENT ,
11575+ environment ,
1157611576 { blockbenchVersion, force : true } ,
1157711577 {
1157811578 onDownloadStart : ( version2 ) => info ( `Downloading Blockbench ${ version2 } ` ) ,
@@ -11586,7 +11586,7 @@ async function ensurePortable(eb, blockbenchVersion) {
1158611586 }
1158711587 ) ;
1158811588 }
11589- const env = await eb . getEnvironment ( ENVIRONMENT ) ;
11589+ const env = await eb . getEnvironment ( environment ) ;
1159011590 let version = "" ;
1159111591 try {
1159211592 version = await eb . resolveVersion ( env . blockbench_version ) ;
@@ -11604,21 +11604,21 @@ async function ensurePortable(eb, blockbenchVersion) {
1160411604 }
1160511605 return portable ;
1160611606}
11607- async function launchBlockbench ( blockbenchVersion ) {
11607+ async function launchBlockbench ( blockbenchVersion , environment = DEFAULT_ENVIRONMENT ) {
1160811608 const eb = new se ( ) ;
1160911609 await eb . ensureStorageFolder ( ) ;
11610- const userDataDir = ( 0 , import_node_path2 . join ) ( eb . storageDir , ENVIRONMENT ) ;
11610+ const userDataDir = ( 0 , import_node_path2 . join ) ( eb . storageDir , environment ) ;
1161111611 await killByUserData ( userDataDir ) ;
1161211612 for ( const lock of [ "SingletonLock" , "SingletonSocket" , "SingletonCookie" ] ) {
1161311613 try {
1161411614 ( 0 , import_node_fs3 . rmSync ) ( ( 0 , import_node_path2 . join ) ( userDataDir , lock ) , { force : true } ) ;
1161511615 } catch {
1161611616 }
1161711617 }
11618- await ensurePortable ( eb , blockbenchVersion ) ;
11618+ await ensurePortable ( eb , environment , blockbenchVersion ) ;
1161911619 grantFsPermission ( userDataDir , "animated_java" ) ;
1162011620 const debugPort = await getFreePort ( ) ;
11621- const child = await eb . launch ( ENVIRONMENT , {
11621+ const child = await eb . launch ( environment , {
1162211622 extraArgs : [
1162311623 `--remote-debugging-port=${ debugPort } ` ,
1162411624 "--remote-allow-origins=*" ,
@@ -12017,7 +12017,7 @@ async function rendererLoadBlueprint(blueprintPath, fileName, content) {
1201712017 }
1201812018 } ;
1201912019}
12020- async function rendererExport ( ) {
12020+ async function rendererExport ( options ) {
1202112021 const g2 = globalThis ;
1202212022 const aj = g2 . window && g2 . window . AnimatedJava || g2 . AnimatedJava ;
1202312023 if ( ! aj || typeof aj . exportProject !== "function" ) {
@@ -12043,7 +12043,7 @@ async function rendererExport() {
1204312043 let ok = false ;
1204412044 let thrown = null ;
1204512045 try {
12046- ok = await aj . exportProject ( ) ;
12046+ ok = await aj . exportProject ( options || void 0 ) ;
1204712047 } catch ( e ) {
1204812048 thrown = e && ( e . stack || e . message ) || String ( e ) ;
1204912049 } finally {
@@ -12134,7 +12134,7 @@ async function exportBlueprint(bridge, blueprintPath, config) {
1213412134 try {
1213512135 result = await bridge . evaluate (
1213612136 rendererExport ,
12137- [ ] ,
12137+ [ { forceSave : false } ] ,
1213812138 config . exportTimeout * 1e3
1213912139 ) ;
1214012140 } catch ( e ) {
0 commit comments