@@ -15,28 +15,28 @@ let lernaModuleLocations: string[] = [];
1515let TARGET_SCOPE = '@bitgo-beta' ;
1616let filesChanged = 0 ;
1717
18- const setLernaModules = async ( ) : Promise < void > = > {
18+ async function setLernaModules ( ) : Promise < void > {
1919 const modules = await getLernaModules ( ) ;
2020 lernaModules = modules . map ( ( { name } ) => name ) ;
2121 lernaModuleLocations = modules . map ( ( { location } ) => location ) ;
22- } ;
22+ }
2323
24- const replacePackageScopes = ( ) => {
24+ function replacePackageScopes ( ) {
2525 // replace all @bitgo packages & source code with alternate SCOPE
2626 const filePaths = [ ...walk ( path . join ( __dirname , '../' , 'modules' ) ) , ...walk ( path . join ( __dirname , '../' , 'webpack' ) ) ] ;
2727 filePaths . forEach ( ( file ) => {
2828 filesChanged += changeScopeInFile ( file , lernaModules , TARGET_SCOPE ) ;
2929 } ) ;
30- } ;
30+ }
3131
3232// modules/bitgo is the only package we publish without an `@bitgo` prefix, so
3333// we must manually set one
34- const replaceBitGoPackageScope = ( ) => {
34+ function replaceBitGoPackageScope ( ) {
3535 const cwd = path . join ( __dirname , '../' , 'modules' , 'bitgo' ) ;
3636 const json = JSON . parse ( readFileSync ( path . join ( cwd , 'package.json' ) , { encoding : 'utf-8' } ) ) ;
3737 json . name = `${ TARGET_SCOPE } /bitgo` ;
3838 writeFileSync ( path . join ( cwd , 'package.json' ) , JSON . stringify ( json , null , 2 ) + '\n' ) ;
39- } ;
39+ }
4040
4141/** Small version checkers in place of an npm dependency installation */
4242function compareversion ( version1 , version2 ) {
@@ -73,7 +73,7 @@ function compareversion(version1, version2) {
7373 *
7474 * @param {String | undefined } preid
7575 */
76- const incrementVersions = async ( preid = 'beta' ) => {
76+ async function incrementVersions ( preid = 'beta' ) {
7777 const distTags = await getDistTagsForModuleLocations ( lernaModuleLocations ) ;
7878 for ( let i = 0 ; i < lernaModuleLocations . length ; i ++ ) {
7979 try {
@@ -118,19 +118,19 @@ const incrementVersions = async (preid = 'beta') => {
118118 console . warn ( `Couldn't set next version for ${ lernaModuleLocations [ i ] } ` , e ) ;
119119 }
120120 }
121- } ;
121+ }
122122
123- const getArgs = ( ) => {
123+ function getArgs ( ) {
124124 const args = process . argv . slice ( 2 ) || [ ] ;
125125 const scopeArg = args . find ( ( arg ) => arg . startsWith ( 'scope=' ) ) ;
126126 if ( scopeArg ) {
127127 const split = scopeArg . split ( '=' ) ;
128128 TARGET_SCOPE = split [ 1 ] || TARGET_SCOPE ;
129129 }
130130 console . log ( `Preparing to re-target to ${ TARGET_SCOPE } ` ) ;
131- } ;
131+ }
132132
133- const main = async ( preid ?: string ) => {
133+ async function main ( preid ?: string ) {
134134 getArgs ( ) ;
135135 await setLernaModules ( ) ;
136136 replacePackageScopes ( ) ;
@@ -143,6 +143,6 @@ const main = async (preid?: string) => {
143143 console . error ( 'No files were changed, something must have gone wrong.' ) ;
144144 process . exit ( 1 ) ;
145145 }
146- } ;
146+ }
147147
148148main ( process . argv . slice ( 2 ) [ 0 ] ) ;
0 commit comments