Commit 8b4fe69 1 parent 35a008f commit 8b4fe69 Copy full SHA for 8b4fe69
File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,15 @@ namespace $ {
17
17
return null as $mol_tree2 | null
18
18
}
19
19
20
+ @ $mol_mem
21
+ overrides ( ) {
22
+ const overrides = this . meta ( this . root ( ) . path ( ) )
23
+ return overrides ?. select ( 'override' ) ?. kids
24
+ ?. map (
25
+ item => ( item . kids ?. [ 0 ] . value ?. split ( ' ' ) ?? [ ] ) as [ string , string ]
26
+ ) ?? [ ]
27
+ }
28
+
20
29
@ $mol_mem_key
21
30
protected repo ( path : string ) {
22
31
const vcs_type = this . vcs_type ( )
@@ -29,11 +38,15 @@ namespace $ {
29
38
const parent = mod . parent ( )
30
39
const mapping = this . meta ( parent . path ( ) )
31
40
41
+
32
42
const url_branch = mapping ?. select ( 'pack' , mod . name ( ) , vcs_type ) . kids
33
43
. find ( $mol_guard_defined ) ?. kids [ 0 ]
34
-
35
- const url = url_branch ?. value ?? null
44
+
45
+ let url = url_branch ?. value ?? null
36
46
const branch = url_branch ?. kids [ 0 ] ?. value ?? null
47
+
48
+ const parts = this . overrides ( ) . find ( ( [ from , to ] ) => url ?. startsWith ( from ) )
49
+ if ( url && parts ) url = parts [ 1 ] + url . slice ( parts [ 0 ] . length )
37
50
38
51
return url ? { url, branch } : null
39
52
}
You can’t perform that action at this time.
0 commit comments