Merge pull request #411 from crazy-max/buildx-localstate-regex-fix

buildx: fix regex in fixLocalState func
This commit is contained in:
CrazyMax 2024-07-15 13:29:06 +02:00 committed by GitHub
commit 300c014384
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -192,7 +192,7 @@ export class Buildx {
// https://github.com/docker/buildx/pull/2560 // https://github.com/docker/buildx/pull/2560
private static fixLocalState(ls: LocalState): LocalState { private static fixLocalState(ls: LocalState): LocalState {
const fnTrimToValidContext = function (inp: string): [string, string, boolean] { const fnTrimToValidContext = function (inp: string): [string, string, boolean] {
const match = inp.match(/(.*)(https?:\/{1,2}\S+|ssh:\/\/\S+|git:\/\/\S+)/i); const match = inp.match(/(.*)(https?:\/{1,2}\S+|ssh:\/{1,2}\S+|git:\/{1,2}\S+)/i);
if (match && match.length == 3) { if (match && match.length == 3) {
const trimed = match[1]; const trimed = match[1];
let url = match[2]; let url = match[2];