npm-pkgbuild 10.5.0 → 10.5.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/package.json +2 -2
- package/src/publish.mjs +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "10.5.
|
|
3
|
+
"version": "10.5.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"lint:docs": "documentation lint ./src/**/*.mjs"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@npmcli/arborist": "^5.
|
|
43
|
+
"@npmcli/arborist": "^5.2.0",
|
|
44
44
|
"aggregate-async-iterator": "^1.1.10",
|
|
45
45
|
"commander": "^9.2.0",
|
|
46
46
|
"content-entry": "^5.0.0",
|
package/src/publish.mjs
CHANGED
|
@@ -20,11 +20,11 @@ export async function publish(fileName, destination, properties) {
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
const publish = analysePublish(destination, properties);
|
|
23
|
+
const publish = analysePublish(Object.assign({}, destination), properties);
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
const url = publish.url + "/" + basename(fileName);
|
|
26
26
|
|
|
27
|
-
console.log(`Publishing to ${
|
|
27
|
+
console.log(`Publishing to ${url}`);
|
|
28
28
|
|
|
29
29
|
if (publish.scheme === "http:" || publish.scheme === "https:") {
|
|
30
30
|
const headers = {
|
|
@@ -37,7 +37,7 @@ export async function publish(fileName, destination, properties) {
|
|
|
37
37
|
Buffer.from(publish.user + ":" + publish.password).toString("base64");
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
const response = await fetch(
|
|
40
|
+
const response = await fetch(url, {
|
|
41
41
|
method: "PUT",
|
|
42
42
|
headers,
|
|
43
43
|
body: createReadStream(fileName)
|
|
@@ -45,7 +45,7 @@ export async function publish(fileName, destination, properties) {
|
|
|
45
45
|
|
|
46
46
|
if (!response.ok) {
|
|
47
47
|
throw new Error(
|
|
48
|
-
`Unable to publish to ${
|
|
48
|
+
`Unable to publish to ${url}: ${response.statusText}(${response.statusCode})`
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
}
|