@@ -4,6 +4,7 @@ const os = require('os');
44const path = require ( 'path' ) ;
55const process = require ( 'process' ) ;
66const spawnSync = require ( 'child_process' ) . spawnSync ;
7+ const core = require ( '@actions/core' )
78
89function run ( command ) {
910 console . log ( command ) ;
@@ -43,6 +44,7 @@ const defaultVersion = (image == 'ubuntu16' || image == 'ubuntu18') ? '5.7' : '8
4344const mysqlVersion = parseFloat ( process . env [ 'INPUT_MYSQL-VERSION' ] || defaultVersion ) . toFixed ( 1 ) ;
4445const username = process . env [ 'INPUT_USERNAME' ] || "" ;
4546const password = process . env [ 'INPUT_PASSWORD' ] || "" ;
47+ const mysqlInstallDirectory = process . env [ 'INPUT_INSTALL-DIRECTORY' ] || "" ;
4648
4749// TODO make OS-specific
4850if ( ! [ '8.0' , '5.7' , '5.6' ] . includes ( mysqlVersion ) ) {
@@ -84,15 +86,14 @@ function installWindwos() {
8486 '5.7' : '5.7.32' ,
8587 '5.6' : '5.6.50'
8688 } ;
87- installDir = "C:\\Program Files\\MySQL" ;
88- bin = `C:\\Program Files\\MySQL\\MySQL Server ${ mysqlVersion } \\bin` ;
89- if ( ! fs . existsSync ( installDir ) ) {
89+ bin = `${ mysqlInstallDirectory } \\bin` ;
90+ if ( ! fs . existsSync ( mysqlInstallDirectory ) ) {
9091 const fullVersion = versionMap [ mysqlVersion ] ;
9192 useTmpDir ( ) ;
9293 run ( `curl -Ls -o mysql.zip https://dev.mysql.com/get/Downloads/MySQL-${ mysqlVersion } /mysql-${ fullVersion } -winx64.zip` )
9394 run ( `unzip -q mysql.zip` ) ;
94- fs . mkdirSync ( installDir ) ;
95- fs . renameSync ( `mysql-${ fullVersion } -winx64` , `C:\\Program Files\\MySQL\\MySQL Server ${ mysqlVersion } ` ) ;
95+ fs . mkdirSync ( mysqlInstallDirectory ) ;
96+ fs . renameSync ( `mysql-${ fullVersion } -winx64` , mysqlInstallDirectory ) ;
9697
9798 // start
9899 if ( mysqlVersion != '5.6' ) {
0 commit comments