Skip to content

Commit

Permalink
Fix mysql regex for windows in extensions.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Apr 27, 2021
1 parent b0559f7 commit 15c43e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@ async function addExtensionWindows(extension_csv, version) {
case /(5\.[3-6]|7\.0)pcov/.test(version_extension):
add_script += await utils.getUnsupportedLog('pcov', version, 'win32');
break;
case /^5\.[3-6](mysql|mysqli|mysqlnd)$/.test(version_extension):
case /^5\.[3-6](?<!pdo_)(mysql|mysqli|mysqlnd)$/.test(version_extension):
add_script +=
'\nAdd-Extension mysql\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
break;
case /(?<!5\.[3-6])(mysql|mysqli|mysqlnd)$/.test(version_extension):
case /(?<!5\.[3-6])(?<!pdo_)(mysql|mysqli|mysqlnd)$/.test(version_extension):
add_script += '\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
break;
case /^sqlite$/.test(extension):
Expand Down
6 changes: 4 additions & 2 deletions src/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,14 @@ export async function addExtensionWindows(
add_script += await utils.getUnsupportedLog('pcov', version, 'win32');
break;
// match 5.3 to 5.6 - mysql, mysqli, mysqlnd
case /^5\.[3-6](mysql|mysqli|mysqlnd)$/.test(version_extension):
case /^5\.[3-6](?<!pdo_)(mysql|mysqli|mysqlnd)$/.test(version_extension):
add_script +=
'\nAdd-Extension mysql\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
break;
// match 7.0 and newer mysql, mysqli and mysqlnd
case /(?<!5\.[3-6])(mysql|mysqli|mysqlnd)$/.test(version_extension):
case /(?<!5\.[3-6])(?<!pdo_)(mysql|mysqli|mysqlnd)$/.test(
version_extension
):
add_script += '\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
break;
// match sqlite
Expand Down

0 comments on commit 15c43e8

Please sign in to comment.