diff --git a/dist/src/index.js b/dist/src/index.js index 6b68ab1..8ca6683 100644 --- a/dist/src/index.js +++ b/dist/src/index.js @@ -74,11 +74,6 @@ async function createDB(opts) { if (throwUnsupportedError) { throw `A version of MySQL is installed on your system that is not supported by this package. If you want to download a MySQL binary instead of getting this error, please set the option "ignoreUnsupportedSystemVersion" to true.`; } - if (options.version && (0, semver_1.lt)(options.version, constants_1.MIN_SUPPORTED_MYSQL)) { - //The difference between the throw here and the throw above is this throw is because the selected "version" is not supported. - //The throw above is because the system-installed MySQL is out of date and "ignoreUnsupportedSystemVersion" is not set to true. - throw `The selected version of MySQL (${options.version}) is not currently supported by this package. Please choose a different version to use.`; - } logger.log('Version currently installed:', version); if (version === null || (options.version && !(0, semver_1.satisfies)(version.version, options.version)) || unsupportedMySQLIsInstalled) { let binaryInfo; @@ -94,6 +89,11 @@ async function createDB(opts) { } throw `A MySQL binary could not be found that supports your OS (${os.platform()} | ${os.version()} | ${os.release()}) and CPU architecture (${os.arch()}). Please check you have the latest version of mysql-memory-server. If the latest version still doesn't support your OS and CPU architecture, feel free to make a pull request to add support!`; } + if ((0, semver_1.lt)(binaryInfo.version, constants_1.MIN_SUPPORTED_MYSQL)) { + //The difference between the throw here and the throw above is this throw is because the selected "version" is not supported. + //The throw above is because the system-installed MySQL is out of date and "ignoreUnsupportedSystemVersion" is not set to true. + throw `The selected version of MySQL (${options.version}) is not currently supported by this package. Please choose a different version to use.`; + } try { binaryFilepath = await (0, Downloader_1.downloadBinary)(binaryInfo, options, logger); } diff --git a/package-lock.json b/package-lock.json index 6e59967..bdc053a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mysql-memory-server", - "version": "1.8.0", + "version": "1.8.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mysql-memory-server", - "version": "1.8.0", + "version": "1.8.1", "license": "MIT", "dependencies": { "adm-zip": "^0.5.16", diff --git a/package.json b/package.json index 9906575..a35d04d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mysql-memory-server", - "version": "1.8.0", + "version": "1.8.1", "description": "Spin up an ephemeral MySQL database from your JavaScript code", "main": "dist/src/index.js", "types": "dist/src/index.d.ts",