zx-bulk-release 1.14.1 → 1.14.2
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/CHANGELOG.md +5 -0
- package/package.json +1 -1
- package/src/main/js/publish.js +10 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [1.14.2](https://github.com/semrel-extra/zx-bulk-release/compare/v1.14.1...v1.14.2) (2022-06-27)
|
|
2
|
+
|
|
3
|
+
### Fixes & improvements
|
|
4
|
+
* refactor: memoize origins ([4df0550](https://github.com/semrel-extra/zx-bulk-release/commit/4df05504f8a3ba770614374aff792bbc540cb640))
|
|
5
|
+
|
|
1
6
|
## [1.14.1](https://github.com/semrel-extra/zx-bulk-release/compare/v1.14.0...v1.14.1) (2022-06-27)
|
|
2
7
|
|
|
3
8
|
### Fixes & improvements
|
package/package.json
CHANGED
package/src/main/js/publish.js
CHANGED
|
@@ -225,7 +225,7 @@ export const parseEnv = (env = process.env) => {
|
|
|
225
225
|
|
|
226
226
|
export const parseRepo = async (cwd) => {
|
|
227
227
|
const {ghToken, ghUser} = parseEnv($.env)
|
|
228
|
-
const originUrl =
|
|
228
|
+
const originUrl = await getOrigin(cwd)
|
|
229
229
|
const [,,repoHost, repoName] = originUrl.replace(':', '/').replace(/\.git/, '').match(/.+(@|\/\/)([^/]+)\/(.+)$/) || []
|
|
230
230
|
const repoPublicUrl = `https://${repoHost}/${repoName}`
|
|
231
231
|
const repoAuthedUrl = ghToken && ghUser && repoHost && repoName?
|
|
@@ -240,3 +240,12 @@ export const parseRepo = async (cwd) => {
|
|
|
240
240
|
originUrl,
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
+
|
|
244
|
+
const origins = {}
|
|
245
|
+
export const getOrigin = async (cwd) => {
|
|
246
|
+
if (!origins[cwd]) {
|
|
247
|
+
origins[cwd] = (await $.o({cwd})`git config --get remote.origin.url`).toString().trim()
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return origins[cwd]
|
|
251
|
+
}
|