@xhmikosr/bin-wrapper 5.0.1 → 6.0.1
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/index.js +12 -8
- package/package.json +11 -16
- package/readme.md +1 -1
package/index.js
CHANGED
|
@@ -124,7 +124,7 @@ export default class BinWrapper {
|
|
|
124
124
|
runCheck(cmd) {
|
|
125
125
|
return binCheck(this.path(), cmd).then(works => {
|
|
126
126
|
if (!works) {
|
|
127
|
-
throw new Error(`The
|
|
127
|
+
throw new Error(`The "${this.path()}" binary doesn't seem to work correctly`);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
if (this.version()) {
|
|
@@ -140,7 +140,7 @@ export default class BinWrapper {
|
|
|
140
140
|
*/
|
|
141
141
|
findExisting() {
|
|
142
142
|
return fs.stat(this.path()).catch(error => {
|
|
143
|
-
if (error
|
|
143
|
+
if (error?.code === 'ENOENT') {
|
|
144
144
|
return this.download();
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -165,11 +165,13 @@ export default class BinWrapper {
|
|
|
165
165
|
urls.push(file.url);
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
return Promise.all(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
168
|
+
return Promise.all(
|
|
169
|
+
urls.map(url => download(url, this.dest(), {
|
|
170
|
+
extract: true,
|
|
171
|
+
strip: this.options.strip,
|
|
172
|
+
})),
|
|
173
|
+
).then(result => {
|
|
174
|
+
const resultFiles = result.flatMap((item, index) => {
|
|
173
175
|
if (Array.isArray(item)) {
|
|
174
176
|
return item.map(file => file.path);
|
|
175
177
|
}
|
|
@@ -180,7 +182,9 @@ export default class BinWrapper {
|
|
|
180
182
|
return parsedPath.base;
|
|
181
183
|
});
|
|
182
184
|
|
|
183
|
-
return Promise.all(
|
|
185
|
+
return Promise.all(
|
|
186
|
+
resultFiles.map(file => fs.chmod(path.join(this.dest(), file), 0o755)),
|
|
187
|
+
);
|
|
184
188
|
});
|
|
185
189
|
}
|
|
186
190
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xhmikosr/bin-wrapper",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "Binary wrapper that makes your programs seamlessly available as local dependencies",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "XhmikosR/bin-wrapper",
|
|
@@ -13,13 +13,15 @@
|
|
|
13
13
|
"url": "https://github.com/kevva"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
|
-
"node": "^
|
|
16
|
+
"node": "^14.14.0 || >=16.0.0"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"ava": "ava",
|
|
20
|
+
"lint": "xo",
|
|
20
21
|
"xo": "xo",
|
|
22
|
+
"fix": "xo --fix",
|
|
21
23
|
"test": "npm run xo && npm run ava",
|
|
22
|
-
"test-ci": "
|
|
24
|
+
"test-ci": "c8 ava"
|
|
23
25
|
},
|
|
24
26
|
"main": "index.js",
|
|
25
27
|
"type": "module",
|
|
@@ -35,26 +37,19 @@
|
|
|
35
37
|
"local",
|
|
36
38
|
"wrapper"
|
|
37
39
|
],
|
|
38
|
-
"c8": {
|
|
39
|
-
"reporter": [
|
|
40
|
-
"lcovonly",
|
|
41
|
-
"text"
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
40
|
"dependencies": {
|
|
45
|
-
"@xhmikosr/downloader": "^
|
|
41
|
+
"@xhmikosr/downloader": "^10.0.2",
|
|
46
42
|
"bin-check": "^4.1.0",
|
|
47
43
|
"bin-version-check": "^5.0.0",
|
|
48
44
|
"os-filter-obj": "^2.0.0"
|
|
49
45
|
},
|
|
50
46
|
"devDependencies": {
|
|
51
|
-
"ava": "^
|
|
52
|
-
"c8": "^7.
|
|
47
|
+
"ava": "^5.3.0",
|
|
48
|
+
"c8": "^7.13.0",
|
|
53
49
|
"executable": "^4.1.1",
|
|
54
|
-
"nock": "^13.
|
|
50
|
+
"nock": "^13.3.1",
|
|
55
51
|
"path-exists": "^5.0.0",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"xo": "^0.49.0"
|
|
52
|
+
"tempy": "^3.0.0",
|
|
53
|
+
"xo": "^0.54.2"
|
|
59
54
|
}
|
|
60
55
|
}
|
package/readme.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# bin-wrapper [](https://github.com/XhmikosR/bin-wrapper/actions/workflows/ci.yml)
|
|
1
|
+
# bin-wrapper [](https://github.com/XhmikosR/bin-wrapper/actions/workflows/ci.yml)
|
|
2
2
|
|
|
3
3
|
> Binary wrapper that makes your programs seamlessly available as local dependencies
|
|
4
4
|
|