mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-09-08 22:04:10 +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:
@ -13,8 +13,7 @@ parse_args() {
|
||||
# Function to log if a library is installed
|
||||
add_lib_log() {
|
||||
lib=$1
|
||||
output=$2
|
||||
if [ "x$output" != "x" ]; then
|
||||
if check_lib "$lib"; then
|
||||
add_log "${tick:?}" "$lib" "Installed"
|
||||
else
|
||||
add_log "${cross:?}" "$lib" "Could not install $lib"
|
||||
|
@ -247,6 +247,9 @@ export async function extensionArray(
|
||||
return extension_csv
|
||||
.split(',')
|
||||
.map(function (extension: string) {
|
||||
if (/.+-.+\/.+@.+/.test(extension)) {
|
||||
return extension;
|
||||
}
|
||||
return extension
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
@ -443,13 +446,14 @@ export async function customPackage(
|
||||
* Function to extension input for installation from source.
|
||||
*
|
||||
* @param extension
|
||||
* @param prefix
|
||||
*/
|
||||
export async function parseExtensionSource(
|
||||
extension: string,
|
||||
prefix: string
|
||||
): Promise<string> {
|
||||
// Groups: extension, domain url, org, repo, release
|
||||
const regex = /(\w+)-(.+:\/\/.+(?:[.:].+)+(?:\/))?([\w.-]+)\/([\w.-]+)@(.+)/;
|
||||
const regex = /(\w+)-(.+:\/\/.+(?:[.:].+)+\/)?([\w.-]+)\/([\w.-]+)@(.+)/;
|
||||
const matches = regex.exec(extension) as RegExpExecArray;
|
||||
matches[2] = matches[2] ? matches[2].slice(0, -1) : 'https://github.com';
|
||||
return await joins(
|
||||
|
Reference in New Issue
Block a user