File tree Expand file tree Collapse file tree 3 files changed +24
-135
lines changed Expand file tree Collapse file tree 3 files changed +24
-135
lines changed Original file line number Diff line number Diff line change 63
63
"@eslint/js" : " ^9.18.0" ,
64
64
"@stylistic/eslint-plugin-js" : " ^2.13.0" ,
65
65
"commander" : " ^13.0.0" ,
66
- "current-git-branch" : " ^1.1.0" ,
67
66
"esbuild-register" : " ^3.6.0" ,
68
67
"eslint-plugin-import-x" : " ^4.6.1" ,
69
68
"eslint-plugin-n" : " ^17.15.1" ,
86
85
"vue-eslint-parser" : " ^9.4.3"
87
86
},
88
87
"devDependencies" : {
89
- "@types/current-git-branch" : " ^1.1.6" ,
90
88
"@types/eslint" : " ^9.6.1" ,
91
89
"@types/interpret" : " ^1.1.3" ,
92
90
"@types/jsonfile" : " ^6.1.4" ,
Original file line number Diff line number Diff line change 4
4
import path from 'node:path'
5
5
import { execSync } from 'node:child_process'
6
6
import { existsSync , readdirSync } from 'node:fs'
7
+ import { platform } from 'node:os'
7
8
import * as semver from 'semver'
8
- import currentGitBranch from 'current-git-branch'
9
9
import { parse as parseCommit } from '@commitlint/parse'
10
10
import { simpleGit } from 'simple-git'
11
11
import {
@@ -16,6 +16,29 @@ import {
16
16
updatePackageJson ,
17
17
} from './utils.js'
18
18
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
+
19
42
/**
20
43
* Execute a script being published
21
44
* @param {import('./index.js').Options } options
You can’t perform that action at this time.
0 commit comments