npm-pkgbuild 10.14.13 → 10.14.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "10.14.13",
3
+ "version": "10.14.14",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -92,12 +92,14 @@ export class Packager {
92
92
  out[nd[0]] = nd[1];
93
93
  }
94
94
 
95
- if (options.publish?.length) {
96
- const publish = analysePublish(options.publish[0], out.properties);
95
+ if (options.publish) {
96
+ for(const op of options.publish) {
97
+ const publish = analysePublish(op, out.properties);
97
98
 
98
- out.destination = publish.scheme === "file:" ? publish.url : tmpdir;
99
-
100
- await mkdir(dirname(out.destination), { recursive: true });
99
+ out.destination = publish.scheme === "file:" ? publish.url : tmpdir;
100
+
101
+ await mkdir(out.destination, { recursive: true });
102
+ }
101
103
  }
102
104
 
103
105
  return out;
package/src/publish.mjs CHANGED
@@ -30,16 +30,15 @@ export async function publish(fileName, destination, properties) {
30
30
 
31
31
  console.log(`Publishing to ${url}`);
32
32
 
33
- switch(publish.scheme) {
33
+ switch (publish.scheme) {
34
34
  case "file:":
35
- if(url.pathname !== fileName) {
35
+ if (url.pathname !== fileName) {
36
36
  await mkdir(publish.url, { recursive: true });
37
37
  await copyFile(fileName, url);
38
38
  }
39
- break;
39
+ break;
40
40
  case "http:":
41
- case "https:":
42
- {
41
+ case "https:": {
43
42
  const headers = {
44
43
  "user-agent": properties["user-agent"] || "npm-pkgbuild"
45
44
  };
@@ -100,7 +99,7 @@ export function preparePublish(publish = [], env = {}) {
100
99
  url.password = "";
101
100
 
102
101
  return {
103
- url: url.href.replace(/%7B/g,'{').replace(/%7D/g,'}'),
102
+ url: url.href.replace(/%7B/g, "{").replace(/%7D/g, "}"),
104
103
  ...(username.length ? { username, password } : {})
105
104
  };
106
105
  } catch {