@@ -54,9 +54,14 @@ workingDirectory = path.isAbsolute(workingDirectory)
5454 ? workingDirectory
5555 : path . join ( process . cwd ( ) , workingDirectory ) ;
5656
57+ function cli ( cmd : string ) {
58+ console . log ( `cli: ${ cmd } ` ) ;
59+ return cp . execSync ( cmd ) . toString ( ) . trim ( ) ;
60+ }
61+
5762function getEsyCLIVersion ( ) {
5863 const cmd = "esy --version" ;
59- return cp . execSync ( cmd ) . toString ( ) . trim ( ) ;
64+ return cli ( cmd ) ;
6065}
6166
6267function getEsyStoreVersion ( ) {
@@ -106,7 +111,7 @@ function getCompilerVersion(sandbox?: string) {
106111 const ocamlcVersionCmd = sandbox
107112 ? `esy ${ sandbox } ocamlc --version`
108113 : "esy ocamlc --version" ;
109- return cp . execSync ( ocamlcVersionCmd ) . toString ( ) ;
114+ return cli ( ocamlcVersionCmd ) ;
110115}
111116
112117async function run ( name : string , command : string , args : string [ ] ) {
@@ -468,17 +473,13 @@ async function bundleNPMArtifacts() {
468473 mainPackageJson . esy . release &&
469474 mainPackageJson . esy . release . rewritePrefix ;
470475
471- function exec ( cmd : string ) {
472- console . log ( `exec: ${ cmd } ` ) ;
473- return cp . execSync ( cmd ) . toString ( ) . trim ( ) ;
474- }
475- const version = exec ( "git describe --tags --always" ) ;
476-
477476 const compilerVersion = getCompilerVersion ( ) ;
478477 console . log ( "Found compiler version" , compilerVersion ) ;
479478 const staticCompilerVersion = getCompilerVersion ( "static.esy" ) ;
480479 console . log ( "Found static compiler version" , staticCompilerVersion ) ;
481480
481+ const version = cli ( "git describe --tags --always" ) ;
482+
482483 const packageJson = JSON . stringify (
483484 {
484485 name : mainPackageJson . name ,
0 commit comments