Skip to content

Commit 50e65ae

Browse files
authored
Remove shelljs (#472)
1 parent ac8e5ff commit 50e65ae

File tree

3 files changed

+40
-21
lines changed

3 files changed

+40
-21
lines changed

build-scripts/packageExtension.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import ncp = require('child_process')
77
import esbuild = require('esbuild')
88
import fs = require('fs-extra')
99
import path = require('path')
10-
import shell = require('shelljs')
1110
import folders = require('./scriptUtils')
1211
import os = require('os')
1312

@@ -40,13 +39,9 @@ function installNodePackages(directory: string) {
4039

4140
function generateGitHashFile() {
4241
try {
43-
const response = shell.exec('git rev-parse HEAD', { silent: true })
44-
if (response.code !== 0) {
45-
console.log('Warning: unable to run git rev-parse to get commit hash!')
46-
} else {
47-
console.log(`Putting git hash ${response.stdout.trim()} into the package directory`)
48-
fs.outputFileSync(path.join(folders.packageRoot, '.gitcommit'), response.stdout.trim())
49-
}
42+
const response = ncp.execSync('git rev-parse HEAD', { encoding: 'utf-8' }).toString()
43+
console.log(`Putting git hash ${response.trim()} into the package directory`)
44+
fs.outputFileSync(path.join(folders.packageRoot, '.gitcommit'), response.trim())
5045
} catch (e) {
5146
console.log(`Getting commit hash failed ${e}`)
5247
throw e

package-lock.json

Lines changed: 36 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@
8989
"https-proxy-agent": "^5.0.0",
9090
"js-yaml": "^3.13.1",
9191
"mime-types": "^2.1.30",
92-
"semver": "^7.3.4",
93-
"shelljs": "^0.8.5"
92+
"semver": "^7.3.4"
9493
},
9594
"jest": {
9695
"coverageDirectory": "./coverage/",

0 commit comments

Comments
 (0)