bulk-release 2.11.2 → 2.11.3
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/gh.js +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [2.11.3](https://github.com/semrel-extra/zx-bulk-release/compare/v2.11.2...v2.11.3) (2023-06-27)
|
|
2
|
+
|
|
3
|
+
### Fixes & improvements
|
|
4
|
+
* fix: apply dir strip to tar inners ([3f5ccd8](https://github.com/semrel-extra/zx-bulk-release/commit/3f5ccd89134331604859969c8d10887d27d9aa6f))
|
|
5
|
+
|
|
1
6
|
## [2.11.2](https://github.com/semrel-extra/zx-bulk-release/compare/v2.11.1...v2.11.2) (2023-06-27)
|
|
2
7
|
|
|
3
8
|
### Fixes & improvements
|
package/package.json
CHANGED
package/src/main/js/gh.js
CHANGED
|
@@ -63,20 +63,24 @@ export const ghPages = queuefy(async (pkg) => {
|
|
|
63
63
|
export const ghPrepareAssets = async (assets, _cwd) => {
|
|
64
64
|
const temp = tempy.temporaryDirectory()
|
|
65
65
|
|
|
66
|
-
await Promise.all(assets.map(async ({name, source = 'target/**/*', zip, cwd = _cwd}) => {
|
|
66
|
+
await Promise.all(assets.map(async ({name, source = 'target/**/*', zip, cwd = _cwd, strip = true}) => {
|
|
67
67
|
const patterns = asArray(source)
|
|
68
68
|
const target = path.join(temp, name)
|
|
69
69
|
if (patterns.some(s => s.includes('*'))) {
|
|
70
70
|
zip = true
|
|
71
71
|
}
|
|
72
|
-
const files = await glob(patterns, {cwd, absolute:
|
|
73
|
-
|
|
72
|
+
const files = await glob(patterns, {cwd, absolute: false, onlyFiles: true})
|
|
74
73
|
if (!zip && files.length === 1) {
|
|
75
|
-
await fs.copy(files[0], target)
|
|
74
|
+
await fs.copy(path.join(cwd, files[0]), target)
|
|
76
75
|
return
|
|
77
76
|
}
|
|
78
77
|
|
|
79
|
-
|
|
78
|
+
const common = files.length === 1
|
|
79
|
+
? files[0].lastIndexOf('/') + 1
|
|
80
|
+
: [...(files[0])].findIndex((c, i) => files.some(f => f.charAt(i) !== c))
|
|
81
|
+
const prefix = files[0].slice(0, common)
|
|
82
|
+
|
|
83
|
+
return $.raw`tar -C ${common ? path.join(cwd, prefix) : cwd} -cv${zip ? 'z' : ''}f ${target} ${files.map(f => common ? f.slice(common) : f).join(' ')}`
|
|
80
84
|
}))
|
|
81
85
|
|
|
82
86
|
return temp
|