@@ -10,9 +10,15 @@ type Commits = Await<ReturnType<Octokit["rest"]["repos"]["compareCommits"]>>["da
10
10
11
11
function getCompareLink ( packageName : string , previousTag : string , newTag : string ) {
12
12
// Previous
13
- const previousPackage = execSync (
14
- `git show ${ previousTag } :../../Cargo.lock | grep ${ packageName } ? | head -1 | grep -o '".*"'`
15
- ) . toString ( ) ;
13
+ let previousPackage : string ;
14
+ try {
15
+ previousPackage = execSync (
16
+ `git show ${ previousTag } :../../Cargo.lock | grep ${ packageName } ? | head -1 | grep -o '".*"'`
17
+ ) . toString ( ) ;
18
+ } catch ( error ) {
19
+ console . error ( 'An error occurred while executing the shell command:' , error ) ;
20
+ return ""
21
+ }
16
22
17
23
const previousCommitTmp = / # ( [ 0 - 9 a - f ] * ) / g. exec ( previousPackage ) ;
18
24
if ( previousCommitTmp == null ) { // regexp didn't match
@@ -27,9 +33,16 @@ function getCompareLink(packageName: string, previousTag: string, newTag: string
27
33
const previousRepo = previousRepoTmp [ 1 ] ;
28
34
29
35
// New
30
- const newPackage = execSync (
31
- `git show ${ newTag } :../../Cargo.lock | grep ${ packageName } ? | head -1 | grep -o '".*"'`
32
- ) . toString ( ) ;
36
+ let newPackage : string ;
37
+ try {
38
+ newPackage = execSync (
39
+ `git show ${ newTag } :../../Cargo.lock | grep ${ packageName } ? | head -1 | grep -o '".*"'`
40
+ ) . toString ( ) ;
41
+ } catch ( error ) {
42
+ console . error ( 'An error occurred while executing the shell command:' , error ) ;
43
+ return ""
44
+ }
45
+
33
46
const newCommitTmp = / # ( [ 0 - 9 a - f ] * ) / g. exec ( newPackage )
34
47
if ( newCommitTmp == null ) {
35
48
return ""
@@ -255,7 +268,7 @@ async function main() {
255
268
getRuntimeInfo ( argv [ "srtool-report-folder" ] , runtimeName )
256
269
) ;
257
270
258
- const moduleLinks = [ "substrate" , " polkadot" , "cumulus ", "frontier" ] . map ( ( repoName ) => ( {
271
+ const moduleLinks = [ "polkadot-sdk " , "frontier" ] . map ( ( repoName ) => ( {
259
272
name : repoName ,
260
273
link : getCompareLink ( repoName , previousTag , newTag ) ,
261
274
} ) ) ;
0 commit comments