11#!/usr/bin/env npx ts-node
2- import yargs from 'yargs' ;
2+ import yargs , { boolean } from 'yargs' ;
33import type { Argv } from 'yargs' ;
44import { hideBin } from 'yargs/helpers' ;
55import { promises as fs } from 'fs' ;
@@ -18,7 +18,7 @@ const argv = yargs(hideBin(process.argv))
1818 // Dor dev versions we need this from evergreen. For beta or stable we get
1919 // it from the package.json
2020 if ( process . env . DEV_VERSION_IDENTIFIER ) {
21- argv . version = process . env . DEV_VERSION_IDENTIFIER ;
21+ argv . devVersion = process . env . DEV_VERSION_IDENTIFIER ;
2222 }
2323
2424 argv . isWindows = process . env . IS_WINDOWS === 'true' ;
@@ -33,6 +33,27 @@ const argv = yargs(hideBin(process.argv))
3333 . detectLocale ( false )
3434 . version ( false )
3535 . strict ( )
36+ . option ( 'bucketName' , {
37+ type : 'string' ,
38+ } )
39+ . option ( 'bucketKeyPrefix' , {
40+ type : 'string' ,
41+ } )
42+ . option ( 'devVersion' , {
43+ type : 'string' ,
44+ } )
45+ . option ( 'isWindows' , {
46+ type : 'boolean' ,
47+ } )
48+ . option ( 'isOSX' , {
49+ type : 'boolean' ,
50+ } )
51+ . option ( 'isRHEL' , {
52+ type : 'boolean' ,
53+ } )
54+ . option ( 'isUbuntu' , {
55+ type : 'boolean' ,
56+ } )
3657 . option ( 'arch' , {
3758 type : 'string' ,
3859 choices : [ 'x64' , 'arm64' ] ,
@@ -88,10 +109,12 @@ async function run() {
88109 console . log ( 'context' , context ) ;
89110
90111 const compassDir = path . resolve ( __dirname , '..' , '..' , 'packages' , 'compass' ) ;
91- // TODO: load version from either DEV_VERSION_IDENTIFIER if set or version in packages/compass/package.json
92- const version = JSON . parse (
93- await fs . readFile ( path . join ( compassDir , 'package.json' ) , 'utf8' )
94- ) . version as string ;
112+ // use the specified DEV_VERSION_IDENTIFIER if set or load version from packages/compass/package.json
113+ const version = context . devVersion
114+ ? context . devVersion
115+ : ( JSON . parse (
116+ await fs . readFile ( path . join ( compassDir , 'package.json' ) , 'utf8' )
117+ ) . version as string ) ;
95118 const platform = platformFromContext ( context ) ;
96119 const outPath = path . resolve ( __dirname , 'hadron-build-info.json' ) ;
97120
0 commit comments