This repository was archived by the owner on May 9, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -61,13 +61,13 @@ export const platformManeger = {
6161 async getPhar ( version : string | boolean ) {
6262 return platformManeger . pocketmine . find ( version ) . then ( res => httpRequests . fetchBuffer ( res . url ) ) ;
6363 } ,
64- async getPhp ( query : { os ?: string , arch ?: string } ) {
65- let os = RegExp ( ( query . os as string ) || "(win32|windows|linux|macos|mac)" ) ;
66- let arch = RegExp ( ( query . arch as string ) || ".*" ) ;
64+ async getPhp ( query ? : { os ?: string , arch ?: string } ) {
65+ let os = RegExp ( query ? .os || "(win32|windows|linux|macos|mac)" ) ;
66+ let arch = RegExp ( query ? .arch || ".*" ) ;
6767 const rele = await httpRequests . GithubRelease ( "The-Bds-Maneger/Build-PHP-Bins" ) ;
6868 for ( const release of rele ) {
6969 for ( const asset of release . assets ) {
70- if ( os . test ( asset . name ) && arch . test ( asset . name ) ) return httpRequests . fetchBuffer ( asset . browser_download_url ) ;
70+ if ( os . test ( asset . name ) && arch . test ( asset . name ) ) return { buffer : await httpRequests . fetchBuffer ( asset . browser_download_url ) , name : asset . name } ;
7171 }
7272 }
7373 throw new Error ( "No bin found" ) ;
@@ -93,4 +93,4 @@ export const platformManeger = {
9393 async find ( version : string | boolean ) { return findVersion < paperSchema > ( "paper" , version ) ; } ,
9494 async getJar ( version : string | boolean ) { return platformManeger . paper . find ( version ) . then ( res => httpRequests . fetchBuffer ( res . url ) ) }
9595 }
96- } ;
96+ } ;
You can’t perform that action at this time.
0 commit comments