mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-09-11 23:34:07 +07:00
Use EXTENSION_PATH to specify subdirectory in add_extension_from_source
This commit is contained in:
@ -448,12 +448,10 @@ export async function parseExtensionSource(
|
||||
extension: string,
|
||||
prefix: string
|
||||
): Promise<string> {
|
||||
// Groups: extension, domain url, org, repo, subdirectory, release
|
||||
// https://regex101.com/r/P3rJiy/1
|
||||
const regex = /(\w+)-(.+:\/\/.+(?:[.:][^/]+)+)?(?:\/)?([^/]+)\/([^/]+)(?:\/)?(.+)*@(.+)/;
|
||||
// Groups: extension, domain url, org, repo, release
|
||||
const regex = /(\w+)-(.+:\/\/.+(?:[.:].+)+(?:\/))?([\w.-]+)\/([\w.-]+)@(.+)/;
|
||||
const matches = regex.exec(extension) as RegExpExecArray;
|
||||
matches[2] = matches[2] ?? 'https://github.com';
|
||||
matches[5] = matches[5] ?? '.';
|
||||
matches[2] = matches[2] ? matches[2].slice(0, -1) : 'https://github.com';
|
||||
return await joins(
|
||||
'\nadd_extension_from_source',
|
||||
...matches.splice(1, matches.length),
|
||||
|
Reference in New Issue
Block a user