File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " clone-with-devpod-extension" ,
33 "private" : true ,
4- "version" : " 0.3.1 " ,
4+ "version" : " 0.3.3 " ,
55 "type" : " module" ,
66 "license" : " MIT" ,
77 "scripts" : {
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ export class EGithubParseError extends EIntegrationParseError {
2323}
2424
2525function isPR ( url : string | URL ) {
26- return / [ / ] (?< repo > [ ^ / ] + [ / ] [ ^ / ] + ) ( [ / ] ? p u l l [ / ] ( \d + ) ) ? / i. test ( url . toString ( ) ) ;
26+ return / ^ h t t p s ? : [ / ] [ / ] [ ^ / ] + [ / ] (?< repo > [ ^ / ] + [ / ] [ ^ / ] + ) ( [ / ] ? p u l l [ / ] ( \d + ) ) / i. test (
27+ url . toString ( ) ,
28+ ) ;
2729}
2830
2931export const Github : Integration = {
@@ -48,7 +50,7 @@ export const Github: Integration = {
4850 } ,
4951 getRepo ( { url } ) {
5052 const results =
51- / [ / ] (?< repo > [ ^ / ] + [ / ] [ ^ / ] + ) ( [ / ] ? t r e e [ / ] (?< branch > [ ^ ? ] + ) ) ? / i. exec (
53+ / ^ h t t p s ? : [ / ] [ / ] [ ^ / ] + [ / ] (?< repo > [ ^ / ] + [ / ] [ ^ / ] + ) ( [ / ] ? t r e e [ / ] (?< branch > [ ^ ? ] + ) ) ? / i. exec (
5254 url . toString ( ) ,
5355 ) ?. groups ;
5456 if ( ! results ) {
@@ -101,7 +103,7 @@ export const Github: Integration = {
101103 return branch ;
102104 } else {
103105 const results =
104- / [ / ] (?< repo > [ ^ / ] + [ / ] [ ^ / ] + ) ( [ / ] ? t r e e [ / ] (?< branch > [ ^ ? ] + ) ) / i. exec (
106+ / ^ h t t p s ? : [ / ] [ / ] [ ^ / ] + [ / ] (?< repo > [ ^ / ] + [ / ] [ ^ / ] + ) ( [ / ] ? t r e e [ / ] (?< branch > [ ^ ? ] + ) ) ? / i. exec (
105107 url . toString ( ) ,
106108 ) ?. groups ;
107109 if ( ! results ) {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export const GitLab: Integration = {
4949 } ,
5050 getRepo ( { url } ) {
5151 const results =
52- / [ / ] (?< repo > [ ^ / ] + [ / ] [ ^ / ] + ) ( [ / ] ? t r e e [ / ] (?< branch > [ ^ ? ] + ) ) ? / i. exec (
52+ / ^ h t t p s ? : [ / ] [ / ] [ ^ / ] + [ / ] (?< repo > [ ^ / ] + [ / ] [ ^ / ] + ) ( [ / ] ? t r e e [ / ] (?< branch > [ ^ ? ] + ) ) ? / i. exec (
5353 url . toString ( ) ,
5454 ) ?. groups ;
5555 if ( ! results ) {
@@ -101,13 +101,14 @@ export const GitLab: Integration = {
101101 }
102102 return branch ;
103103 } else {
104- const results = / [ / ] [ ^ / ] + [ / ] [ ^ / ] + [ / ] - [ / ] t r e e [ / ] (?< branch > [ ^ ? ] + ) / i. exec (
105- url . toString ( ) ,
106- ) ?. groups ;
104+ const results =
105+ / ^ h t t p s ? : [ / ] [ / ] [ ^ / ] + [ / ] [ ^ / ] + [ / ] [ ^ / ] + [ / ] - [ / ] t r e e [ / ] (?< branch > [ ^ ? ] + ) / i. exec (
106+ url . toString ( ) ,
107+ ) ?. groups ;
107108 if ( ! results ) {
108109 throw new EGitLabParseError ( {
109110 data : {
110- url : window . location . href ,
111+ url : url . toString ( ) ,
111112 integration : "GitLab" ,
112113 cause : "no match" ,
113114 process : "branch" ,
Original file line number Diff line number Diff line change @@ -29,9 +29,10 @@ export function getDevPodUrl(url: string) {
2929 throw error ;
3030 }
3131 }
32+ const { hostname, protocol } = new URL ( url ) ;
3233
3334 const branchSuffix = branch ? `@${ branch } ` : "" ;
34- return `https://devpod.sh/open#https ://github.com /${ repo } ${ branchSuffix } ` ;
35+ return `https://devpod.sh/open#${ protocol } ://${ hostname } /${ repo } ${ branchSuffix } ` ;
3536 } catch ( error ) {
3637 console . error ( EError . serialize ( error ) ) ;
3738 throw error ;
You can’t perform that action at this time.
0 commit comments