@naturalcycles/nodejs-lib 15.62.1 → 15.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/util/git2.d.ts +1 -0
- package/dist/util/git2.js +25 -0
- package/package.json +1 -1
- package/src/util/git2.ts +26 -0
package/dist/util/git2.d.ts
CHANGED
package/dist/util/git2.js
CHANGED
|
@@ -86,5 +86,30 @@ class Git2 {
|
|
|
86
86
|
const originUrl = exec2.exec('git config --get remote.origin.url');
|
|
87
87
|
return basename(originUrl, '.git');
|
|
88
88
|
}
|
|
89
|
+
getAllBranchesNames() {
|
|
90
|
+
/**
|
|
91
|
+
* Raw output example from this repository:
|
|
92
|
+
* $ git branch -r
|
|
93
|
+
* origin/DEV-22569-zod-isoDate-params
|
|
94
|
+
* origin/DEV-23052-git2-add-method
|
|
95
|
+
* origin/HEAD -> origin/main
|
|
96
|
+
* origin/add-requiredpick-type-helper
|
|
97
|
+
* origin/better-object-keys
|
|
98
|
+
* origin/feat/immutable-j-1
|
|
99
|
+
* origin/feat/immutable-j-2
|
|
100
|
+
* origin/feat/random-string-util
|
|
101
|
+
* origin/fix-vsc-red-line
|
|
102
|
+
* origin/generic-cachekey-function-2
|
|
103
|
+
* origin/gh-pages
|
|
104
|
+
* origin/main
|
|
105
|
+
* origin/stringify-or-undefined
|
|
106
|
+
*/
|
|
107
|
+
return exec2
|
|
108
|
+
.exec('git branch -r')
|
|
109
|
+
.split('\n')
|
|
110
|
+
.map(s => s.trim())
|
|
111
|
+
.filter(s => !s.includes(' -> '))
|
|
112
|
+
.map(s => s.split('/')[1]);
|
|
113
|
+
}
|
|
89
114
|
}
|
|
90
115
|
export const git2 = new Git2();
|
package/package.json
CHANGED
package/src/util/git2.ts
CHANGED
|
@@ -99,6 +99,32 @@ class Git2 {
|
|
|
99
99
|
const originUrl = exec2.exec('git config --get remote.origin.url')
|
|
100
100
|
return basename(originUrl, '.git')
|
|
101
101
|
}
|
|
102
|
+
|
|
103
|
+
getAllBranchesNames(): string[] {
|
|
104
|
+
/**
|
|
105
|
+
* Raw output example from this repository:
|
|
106
|
+
* $ git branch -r
|
|
107
|
+
* origin/DEV-22569-zod-isoDate-params
|
|
108
|
+
* origin/DEV-23052-git2-add-method
|
|
109
|
+
* origin/HEAD -> origin/main
|
|
110
|
+
* origin/add-requiredpick-type-helper
|
|
111
|
+
* origin/better-object-keys
|
|
112
|
+
* origin/feat/immutable-j-1
|
|
113
|
+
* origin/feat/immutable-j-2
|
|
114
|
+
* origin/feat/random-string-util
|
|
115
|
+
* origin/fix-vsc-red-line
|
|
116
|
+
* origin/generic-cachekey-function-2
|
|
117
|
+
* origin/gh-pages
|
|
118
|
+
* origin/main
|
|
119
|
+
* origin/stringify-or-undefined
|
|
120
|
+
*/
|
|
121
|
+
return exec2
|
|
122
|
+
.exec('git branch -r')
|
|
123
|
+
.split('\n')
|
|
124
|
+
.map(s => s.trim())
|
|
125
|
+
.filter(s => !s.includes(' -> '))
|
|
126
|
+
.map(s => s.split('/')[1]!)
|
|
127
|
+
}
|
|
102
128
|
}
|
|
103
129
|
|
|
104
130
|
export const git2 = new Git2()
|