Skip to content

Commit 5d3fdc5

Browse files
committed
Use stripAnsi
1 parent 8402ced commit 5d3fdc5

File tree

9 files changed

+151
-261
lines changed

9 files changed

+151
-261
lines changed

.config/rollup.base.config.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { purgePolyfills } from 'unplugin-purge-polyfills'
1111

1212
import { readPackageJsonSync } from '@socketsecurity/registry/lib/packages'
1313
import { spawnSync } from '@socketsecurity/registry/lib/spawn'
14+
import { stripAnsi } from '@socketsecurity/registry/lib/strings'
1415

1516
import constants from '../scripts/constants.js'
1617
import socketModifyPlugin from '../scripts/rollup/socket-modify-plugin.js'
@@ -63,9 +64,11 @@ function getSocketCliVersionHash() {
6364
const { version } = getRootPkgJsonSync()
6465
let gitHash = ''
6566
try {
66-
gitHash = spawnSync('git', ['rev-parse', '--short', 'HEAD'], {
67-
encoding: 'utf8',
68-
}).stdout.trim()
67+
gitHash = stripAnsi(
68+
spawnSync('git', ['rev-parse', '--short', 'HEAD'], {
69+
encoding: 'utf8',
70+
}).stdout.trim(),
71+
)
6972
} catch {}
7073
// Make each build generate a unique version id, regardless.
7174
// Mostly for development: confirms the build refreshed. For prod builds

package-lock.json

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
"@socketregistry/is-interactive": "1.0.6",
112112
"@socketregistry/packageurl-js": "1.0.8",
113113
"@socketsecurity/config": "3.0.1",
114-
"@socketsecurity/registry": "1.0.216",
114+
"@socketsecurity/registry": "1.0.217",
115115
"@socketsecurity/sdk": "1.4.50",
116116
"@types/blessed": "0.1.25",
117117
"@types/cmd-shim": "5.0.2",
@@ -182,6 +182,7 @@
182182
"@octokit/request-error": "$@octokit/request-error",
183183
"@socketsecurity/registry": "$@socketsecurity/registry",
184184
"aggregate-error": "npm:@socketregistry/aggregate-error@^1",
185+
"ansi-regex": "6.1.0",
185186
"es-define-property": "npm:@socketregistry/es-define-property@^1",
186187
"function-bind": "npm:@socketregistry/function-bind@^1",
187188
"globalthis": "npm:@socketregistry/globalthis@^1",

0 commit comments

Comments
 (0)