2727const fs = require ( 'fs' ) ;
2828const path = require ( 'path' ) ;
2929const globSync = require ( 'glob' ) . sync ;
30- const { execSync} = require ( 'child_process' ) ;
30+ const { execSync, execFileSync } = require ( 'child_process' ) ;
3131const rimraf = require ( 'rimraf' ) ;
3232
3333const TOP = path . resolve ( __dirname , '..' , '..' ) ;
@@ -259,7 +259,7 @@ function semconvChangelogGen(aVer=undefined, bVer=undefined) {
259259
260260 const localDir = path . join ( TOP , 'semantic-conventions' ) ;
261261 const pj = JSON . parse ( fs . readFileSync ( path . join ( localDir , 'package.json' ) ) ) ;
262- const pkgInfo = JSON . parse ( execSync ( ` npm info -j ${ pj . name } ` ) )
262+ const pkgInfo = JSON . parse ( execFileSync ( ' npm' , [ ' info' , '-j' , pj . name ] ) . toString ( ) )
263263
264264 let aDir ;
265265 if ( ! aVer ) {
@@ -271,7 +271,7 @@ function semconvChangelogGen(aVer=undefined, bVer=undefined) {
271271 const tarballUrl = `https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-${ aVer } .tgz` ;
272272 fs . mkdirSync ( path . dirname ( aDir ) ) ;
273273 const cwd = path . dirname ( aDir ) ;
274- execSync ( ` curl -sf -o package.tgz ${ tarballUrl } ` , { cwd } ) ;
274+ execFileSync ( ' curl' , [ ' -sf' , '-o' , ' package.tgz' , tarballUrl ] , { cwd } ) ;
275275 execSync ( `tar xzf package.tgz` , { cwd } ) ;
276276 }
277277
@@ -296,7 +296,7 @@ function semconvChangelogGen(aVer=undefined, bVer=undefined) {
296296 const tarballUrl = `https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-${ bVer } .tgz` ;
297297 fs . mkdirSync ( path . dirname ( bDir ) ) ;
298298 const cwd = path . dirname ( bDir ) ;
299- execSync ( ` curl -sf -o package.tgz ${ tarballUrl } ` , { cwd } ) ;
299+ execFileSync ( ' curl' , [ ' -sf' , '-o' , ' package.tgz' , tarballUrl ] , { cwd } ) ;
300300 execSync ( `tar xzf package.tgz` , { cwd } ) ;
301301 }
302302
0 commit comments