File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -32,18 +32,22 @@ Usage:
32
32
` . trim ( )
33
33
34
34
const args = parseArgs ( Deno . args )
35
- const consoleCommit = args . _ [ 0 ]
35
+ const consoleRevision = args . _ [ 0 ]
36
36
37
- if ( ! consoleCommit ) {
37
+ if ( ! consoleRevision ) {
38
38
console . error ( 'Error: Console commit hash is required\n' )
39
39
console . info ( USAGE )
40
40
Deno . exit ( 1 )
41
41
}
42
42
43
- const fullCommit = await $ `git rev-parse ${ consoleCommit } ` . text ( )
43
+ const isTag = ( await $ `git cat-file -t ${ consoleRevision } ` . noThrow ( ) . text ( ) ) === 'tag'
44
44
45
- if ( consoleCommit !== fullCommit ) {
46
- console . info ( `Resolved ${ consoleCommit } to ${ fullCommit } ` )
45
+ // if console commit is a tag we use ^{} to get the hash of the commit
46
+ // underneath the tag, not of the tag itself
47
+ const fullCommit = await $ `git rev-parse ${ consoleRevision } ${ isTag ? '^{}' : '' } ` . text ( )
48
+
49
+ if ( consoleRevision !== fullCommit ) {
50
+ console . info ( `Resolved ${ consoleRevision } to ${ fullCommit } ` )
47
51
}
48
52
49
53
console . info ( 'Finding nexus zones...' )
You can’t perform that action at this time.
0 commit comments