@@ -72,13 +72,13 @@ const run = async () => {
7272 if ( apt !== '' ) {
7373 if ( apt . includes ( '_update_' ) ) {
7474 execSync ( 'sudo apt-get -qy update' )
75- apt = apt . replace ( / _ u p d a t e _ / gi, '' ) . trim ( )
75+ apt = apt . replace ( / \b _ u p d a t e _ \b / gi, '' ) . trim ( )
7676 }
7777
7878 if ( apt . includes ( '_upgrade_' ) ) {
7979 execSync ( 'sudo apt-get -qy update' )
8080 execSync ( 'sudo apt-get -qy dist-upgrade' )
81- apt = apt . replace ( / _ u p g r a d e _ / gi, '' ) . trim ( )
81+ apt = apt . replace ( / \b _ u p g r a d e _ \b / gi, '' ) . trim ( )
8282 }
8383
8484 if ( apt !== '' ) {
@@ -368,6 +368,7 @@ __webpack_require__.r(__webpack_exports__);
368368/* harmony export (binding) */ __webpack_require__ . d ( __webpack_exports__ , "download" , function ( ) { return download ; } ) ;
369369/* harmony export (binding) */ __webpack_require__ . d ( __webpack_exports__ , "ruby" , function ( ) { return ruby ; } ) ;
370370/* harmony export (binding) */ __webpack_require__ . d ( __webpack_exports__ , "execSync" , function ( ) { return execSync ; } ) ;
371+ /* harmony export (binding) */ __webpack_require__ . d ( __webpack_exports__ , "execSyncQ" , function ( ) { return execSyncQ ; } ) ;
371372/* harmony export (binding) */ __webpack_require__ . d ( __webpack_exports__ , "getInput" , function ( ) { return getInput ; } ) ;
372373
373374
@@ -440,6 +441,12 @@ const execSync = (cmd) => {
440441 cp . execSync ( cmd , { stdio : [ 'ignore' , 'inherit' , 'inherit' ] } )
441442}
442443
444+ const execSyncQ = ( cmd ) => {
445+ console . log ( `[command]${ cmd } ` )
446+ cp . execSync ( cmd , { stdio : [ 'ignore' , 'ignore' , 'inherit' ] } )
447+ console . log ( ' Done' )
448+ }
449+
443450const getInput = ( name ) => core . getInput ( name ) . replace ( / [ ^ a - z _ \d . - ] + / gi, '' ) . trim ( ) . toLowerCase ( )
444451
445452
@@ -455,22 +462,15 @@ __webpack_require__.r(__webpack_exports__);
455462
456463
457464const fs = __webpack_require__ ( 747 )
458- const path = __webpack_require__ ( 622 )
459465const core = __webpack_require__ ( 276 )
460466
461- const { download, execSync, getInput } = __webpack_require__ ( 498 )
467+ const { download, execSync, execSyncQ , getInput } = __webpack_require__ ( 498 )
462468
463- // SSD drive, used for most downloads
469+ // SSD drive, used for most downloads and MSYS
464470const drive = ( process . env [ 'GITHUB_WORKSPACE' ] || 'C' ) [ 0 ]
465471
466- const tar = 'C:\\msys64\\usr\\bin\\tar.exe'
467- const msys2UsrBin = 'C:\\msys64\\usr\\bin'
468-
469- // below are for setup of old Ruby DevKit
470- const dirDK = `C:\\DevKit64`
471- const dirDKTar = `/c/DevKit64/mingw/x86_64-w64-mingw32`
472-
473- const dirDK7z = `C:\\DevKit64\\mingw\\x86_64-w64-mingw32`
472+ // location to extract old MSYS packages
473+ const dirDK7z = `${ drive } :\\DevKit64\\mingw\\x86_64-w64-mingw32`
474474
475475const dlPath = `${ process . env . RUNNER_TEMP } \\srp`
476476if ( ! fs . existsSync ( dlPath ) ) {
@@ -486,6 +486,7 @@ let mingw = getInput('mingw')
486486let msys2 = getInput ( 'msys2' )
487487
488488let pre // set in setRuby, ' mingw-w64-x86_64-' or ' mingw-w64-i686-'
489+ // standard pacman args
489490const args = '--noconfirm --noprogressbar --needed'
490491
491492// Not used. Installs packages stored in GitHub release.
@@ -535,7 +536,7 @@ const openssl = async () => {
535536 await download ( uri , fn )
536537 execSync ( `pacman.exe -R --noconfirm --noprogressbar ${ pre . trim ( ) } openssl` )
537538 execSync ( `pacman.exe -Udd --noconfirm --noprogressbar ${ fn } ` )
538- mingw = mingw . replace ( / o p e n s s l / gi, '' ) . trim ( )
539+ mingw = mingw . replace ( / \b o p e n s s l \b / gi, '' ) . trim ( )
539540 }
540541}
541542
@@ -559,15 +560,15 @@ const installMSYS2 = async () => {
559560 const cmd = `7z x ${ fn } -oC:\\`
560561 await download ( `https://github.com/MSP-Greg/ruby-msys2-package-archive/releases/download/${ RELEASE_ASSET } /msys64.7z` , fn )
561562 fs . rmdirSync ( 'C:\\msys64' , { recursive : true } )
562- execSync ( cmd )
563+ execSyncQ ( cmd )
563564 core . info ( 'Installed MSYS2 for Ruby 2.4 and later' )
564565}
565566
566567// install MinGW packages from mingw input
567568const runMingw = async ( ) => {
568569 if ( mingw . includes ( '_upgrade_' ) ) {
569570 await updateGCC ( )
570- mingw = mingw . replace ( / _ u p g r a d e _ / g, '' ) . trim ( )
571+ mingw = mingw . replace ( / \b _ u p g r a d e _ \b / g, '' ) . trim ( )
571572 }
572573
573574 /* _msvc_ can be used when building mswin Rubies
@@ -600,18 +601,12 @@ const runMingw = async () => {
600601 }
601602 } )
602603 if ( toInstall . length !== 0 ) {
603- // add to Path to make sure MSYS2 tar is in Path for extraction
604- const curPath = process . env . Path
605- process . env . Path = `${ msys2UsrBin } ${ path . delimiter } ${ curPath } `
606604 for ( const item of toInstall ) {
607605 let fn = `${ dlPath } \\${ item . pkg } .tar.lzma`
608606 await download ( item . uri , fn )
609- //fn = fn.replace(/:/, '').replace(/\\/g, '/')
610- //let cmd = `${tar} --lzma -C ${dirDKTar} -xf /${fn}`
611607 let cmd = `7z x -tlzma ${ fn } -so | 7z x -aoa -si -ttar -o${ dirDK7z } `
612- execSync ( cmd )
608+ execSyncQ ( cmd )
613609 }
614- process . env . Path = curPath
615610 }
616611 }
617612 }
@@ -1733,7 +1728,7 @@ const run = async () => {
17331728 if ( ! choco . includes ( 'openssl' ) ) { choco += ' openssl' }
17341729 }
17351730
1736- if ( mingw . includes ( 'ragel' ) ) {
1731+ if ( mingw . includes ( 'ragel' ) && ! mswin . includes ( 'ragel' ) ) {
17371732 execSync ( 'pacman.exe -S --noconfirm --noprogressbar --needed mingw-w64-x86_64-ragel' )
17381733 }
17391734
@@ -1783,13 +1778,13 @@ const run = async () => {
17831778 if ( brew !== '' ) {
17841779 if ( brew . includes ( '_update_' ) ) {
17851780 execSync ( 'brew update' )
1786- brew = brew . replace ( / _ u p d a t e _ / gi, '' ) . trim ( )
1781+ brew = brew . replace ( / \b _ u p d a t e _ \b / gi, '' ) . trim ( )
17871782 }
17881783
17891784 if ( brew . includes ( '_upgrade_' ) ) {
17901785 execSync ( 'brew update' )
17911786 execSync ( 'brew upgrade' )
1792- brew = brew . replace ( / _ u p g r a d e _ / gi, '' ) . trim ( )
1787+ brew = brew . replace ( / \b _ u p g r a d e _ \b / gi, '' ) . trim ( )
17931788 }
17941789
17951790 if ( brew !== '' ) {
0 commit comments