Improve regexes in extensions.ts

This commit is contained in:
Shivam Mathur 2021-02-22 11:49:32 +05:30
parent 0cc14f65a2
commit 0a5e543af7
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
2 changed files with 6 additions and 6 deletions

6
dist/index.js vendored
View File

@ -2761,7 +2761,7 @@ async function addExtensionDarwin(extension_csv, version) {
let command = ''; let command = '';
switch (true) { switch (true) {
// match pre-release versions // match pre-release versions
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): case /.+-(beta|alpha|devel|snapshot)/.test(extension):
script += script +=
'\nadd_unstable_extension ' + '\nadd_unstable_extension ' +
extension_name + extension_name +
@ -2820,7 +2820,7 @@ async function addExtensionWindows(extension_csv, version) {
const version_extension = version + extension; const version_extension = version + extension;
switch (true) { switch (true) {
// match pre-release versions // match pre-release versions
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): case /.+-(beta|alpha|devel|snapshot)/.test(extension):
script += '\nAdd-Extension ' + extension_name + ' ' + stability; script += '\nAdd-Extension ' + extension_name + ' ' + stability;
break; break;
// match 5.6mysql, 5.6mysqli, 5.6mysqlnd // match 5.6mysql, 5.6mysqli, 5.6mysqlnd
@ -2880,7 +2880,7 @@ async function addExtensionLinux(extension_csv, version, pipe) {
let command = ''; let command = '';
switch (true) { switch (true) {
// match pre-release versions // match pre-release versions
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): case /.+-(beta|alpha|devel|snapshot)/.test(extension):
script += script +=
'\nadd_unstable_extension ' + '\nadd_unstable_extension ' +
extension_name + extension_name +

View File

@ -21,7 +21,7 @@ export async function addExtensionDarwin(
let command = ''; let command = '';
switch (true) { switch (true) {
// match pre-release versions // match pre-release versions
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): case /.+-(beta|alpha|devel|snapshot)/.test(extension):
script += script +=
'\nadd_unstable_extension ' + '\nadd_unstable_extension ' +
extension_name + extension_name +
@ -85,7 +85,7 @@ export async function addExtensionWindows(
const version_extension: string = version + extension; const version_extension: string = version + extension;
switch (true) { switch (true) {
// match pre-release versions // match pre-release versions
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): case /.+-(beta|alpha|devel|snapshot)/.test(extension):
script += '\nAdd-Extension ' + extension_name + ' ' + stability; script += '\nAdd-Extension ' + extension_name + ' ' + stability;
break; break;
// match 5.6mysql, 5.6mysqli, 5.6mysqlnd // match 5.6mysql, 5.6mysqli, 5.6mysqlnd
@ -149,7 +149,7 @@ export async function addExtensionLinux(
let command = ''; let command = '';
switch (true) { switch (true) {
// match pre-release versions // match pre-release versions
case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): case /.+-(beta|alpha|devel|snapshot)/.test(extension):
script += script +=
'\nadd_unstable_extension ' + '\nadd_unstable_extension ' +
extension_name + extension_name +