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:
3232` . trim ( )
3333
3434const args = parseArgs ( Deno . args )
35- const consoleCommit = args . _ [ 0 ]
35+ const consoleRevision = args . _ [ 0 ]
3636
37- if ( ! consoleCommit ) {
37+ if ( ! consoleRevision ) {
3838 console . error ( 'Error: Console commit hash is required\n' )
3939 console . info ( USAGE )
4040 Deno . exit ( 1 )
4141}
4242
43- const fullCommit = await $ `git rev-parse ${ consoleCommit } ` . text ( )
43+ const isTag = ( await $ `git cat-file -t ${ consoleRevision } ` . noThrow ( ) . text ( ) ) === 'tag'
4444
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 } ` )
4751}
4852
4953console . info ( 'Finding nexus zones...' )
You can’t perform that action at this time.
0 commit comments