mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Do not lowercase source extension input
Fix warnings in parseExtensionSource in utils.ts Fix add_lib_log in source.sh
This commit is contained in:
parent
fe944a16b5
commit
7e5351f399
6
dist/index.js
vendored
6
dist/index.js
vendored
@ -2818,6 +2818,9 @@ async function extensionArray(extension_csv) {
|
|||||||
return extension_csv
|
return extension_csv
|
||||||
.split(',')
|
.split(',')
|
||||||
.map(function (extension) {
|
.map(function (extension) {
|
||||||
|
if (/.+-.+\/.+@.+/.test(extension)) {
|
||||||
|
return extension;
|
||||||
|
}
|
||||||
return extension
|
return extension
|
||||||
.trim()
|
.trim()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
@ -2976,10 +2979,11 @@ exports.customPackage = customPackage;
|
|||||||
* Function to extension input for installation from source.
|
* Function to extension input for installation from source.
|
||||||
*
|
*
|
||||||
* @param extension
|
* @param extension
|
||||||
|
* @param prefix
|
||||||
*/
|
*/
|
||||||
async function parseExtensionSource(extension, prefix) {
|
async function parseExtensionSource(extension, prefix) {
|
||||||
// Groups: extension, domain url, org, repo, release
|
// Groups: extension, domain url, org, repo, release
|
||||||
const regex = /(\w+)-(.+:\/\/.+(?:[.:].+)+(?:\/))?([\w.-]+)\/([\w.-]+)@(.+)/;
|
const regex = /(\w+)-(.+:\/\/.+(?:[.:].+)+\/)?([\w.-]+)\/([\w.-]+)@(.+)/;
|
||||||
const matches = regex.exec(extension);
|
const matches = regex.exec(extension);
|
||||||
matches[2] = matches[2] ? matches[2].slice(0, -1) : 'https://github.com';
|
matches[2] = matches[2] ? matches[2].slice(0, -1) : 'https://github.com';
|
||||||
return await joins('\nadd_extension_from_source', ...matches.splice(1, matches.length), prefix);
|
return await joins('\nadd_extension_from_source', ...matches.splice(1, matches.length), prefix);
|
||||||
|
@ -13,8 +13,7 @@ parse_args() {
|
|||||||
# Function to log if a library is installed
|
# Function to log if a library is installed
|
||||||
add_lib_log() {
|
add_lib_log() {
|
||||||
lib=$1
|
lib=$1
|
||||||
output=$2
|
if check_lib "$lib"; then
|
||||||
if [ "x$output" != "x" ]; then
|
|
||||||
add_log "${tick:?}" "$lib" "Installed"
|
add_log "${tick:?}" "$lib" "Installed"
|
||||||
else
|
else
|
||||||
add_log "${cross:?}" "$lib" "Could not install $lib"
|
add_log "${cross:?}" "$lib" "Could not install $lib"
|
||||||
|
@ -247,6 +247,9 @@ export async function extensionArray(
|
|||||||
return extension_csv
|
return extension_csv
|
||||||
.split(',')
|
.split(',')
|
||||||
.map(function (extension: string) {
|
.map(function (extension: string) {
|
||||||
|
if (/.+-.+\/.+@.+/.test(extension)) {
|
||||||
|
return extension;
|
||||||
|
}
|
||||||
return extension
|
return extension
|
||||||
.trim()
|
.trim()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
@ -443,13 +446,14 @@ export async function customPackage(
|
|||||||
* Function to extension input for installation from source.
|
* Function to extension input for installation from source.
|
||||||
*
|
*
|
||||||
* @param extension
|
* @param extension
|
||||||
|
* @param prefix
|
||||||
*/
|
*/
|
||||||
export async function parseExtensionSource(
|
export async function parseExtensionSource(
|
||||||
extension: string,
|
extension: string,
|
||||||
prefix: string
|
prefix: string
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
// Groups: extension, domain url, org, repo, release
|
// Groups: extension, domain url, org, repo, release
|
||||||
const regex = /(\w+)-(.+:\/\/.+(?:[.:].+)+(?:\/))?([\w.-]+)\/([\w.-]+)@(.+)/;
|
const regex = /(\w+)-(.+:\/\/.+(?:[.:].+)+\/)?([\w.-]+)\/([\w.-]+)@(.+)/;
|
||||||
const matches = regex.exec(extension) as RegExpExecArray;
|
const matches = regex.exec(extension) as RegExpExecArray;
|
||||||
matches[2] = matches[2] ? matches[2].slice(0, -1) : 'https://github.com';
|
matches[2] = matches[2] ? matches[2].slice(0, -1) : 'https://github.com';
|
||||||
return await joins(
|
return await joins(
|
||||||
|
Loading…
Reference in New Issue
Block a user