Skip to content

Commit 79a811b

Browse files
committed
fix: remove vulnerable dependency
1 parent afac7f8 commit 79a811b

File tree

3 files changed

+24
-135
lines changed

3 files changed

+24
-135
lines changed

packages/config/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"@eslint/js": "^9.18.0",
6464
"@stylistic/eslint-plugin-js": "^2.13.0",
6565
"commander": "^13.0.0",
66-
"current-git-branch": "^1.1.0",
6766
"esbuild-register": "^3.6.0",
6867
"eslint-plugin-import-x": "^4.6.1",
6968
"eslint-plugin-n": "^17.15.1",
@@ -86,7 +85,6 @@
8685
"vue-eslint-parser": "^9.4.3"
8786
},
8887
"devDependencies": {
89-
"@types/current-git-branch": "^1.1.6",
9088
"@types/eslint": "^9.6.1",
9189
"@types/interpret": "^1.1.3",
9290
"@types/jsonfile": "^6.1.4",

packages/config/src/publish/index.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import path from 'node:path'
55
import { execSync } from 'node:child_process'
66
import { existsSync, readdirSync } from 'node:fs'
7+
import { platform } from 'node:os'
78
import * as semver from 'semver'
8-
import currentGitBranch from 'current-git-branch'
99
import { parse as parseCommit } from '@commitlint/parse'
1010
import { simpleGit } from 'simple-git'
1111
import {
@@ -16,6 +16,29 @@ import {
1616
updatePackageJson,
1717
} from './utils.js'
1818

19+
function currentGitBranch() {
20+
let stdout
21+
22+
try {
23+
let cmd = ''
24+
25+
if (platform() === 'win32') {
26+
cmd = `git branch | findstr \\*`
27+
} else {
28+
cmd = `git branch | grep \\*`
29+
}
30+
31+
stdout = execSync(cmd).toString()
32+
} catch (e) {
33+
console.error(e)
34+
return false
35+
}
36+
37+
const branchName = stdout.slice(2, stdout.length).trim()
38+
39+
return branchName
40+
}
41+
1942
/**
2043
* Execute a script being published
2144
* @param {import('./index.js').Options} options

0 commit comments

Comments
 (0)