npm-pkgbuild 8.2.2 → 8.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "8.2.2",
3
+ "version": "8.3.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -47,13 +47,13 @@
47
47
  "content-entry-filesystem": "^4.0.9",
48
48
  "content-entry-transform": "^1.3.15",
49
49
  "execa": "^6.1.0",
50
- "expression-expander": "^7.0.15",
50
+ "expression-expander": "^7.0.16",
51
51
  "globby": "^13.1.0",
52
52
  "ini": "^2.0.0",
53
- "iterable-string-interceptor": "^1.0.14",
53
+ "iterable-string-interceptor": "^1.0.15",
54
54
  "key-value-transformer": "^2.1.1",
55
55
  "node-fetch": "^3.2.3",
56
- "npm-package-walker": "^5.0.5",
56
+ "npm-package-walker": "^5.0.6",
57
57
  "npm-packlist": "^4.0.0",
58
58
  "pacote": "^13.0.5",
59
59
  "pkg-dir": "^6.0.1",
@@ -36,6 +36,7 @@ program
36
36
  )
37
37
  .option("-p --pkgdir <dir>", "which package to use", process.cwd())
38
38
  .option("-a --available", "only excute availabe output methods", false)
39
+ .option("--continue", "continue on error")
39
40
  .option(
40
41
  "-c --content <dir>",
41
42
  "content directory",
@@ -140,8 +141,10 @@ program
140
141
  await publish(fileName, options.publish, properties);
141
142
  }
142
143
  } catch (e) {
143
- console.log(e);
144
- process.exit(-1);
144
+ console.error(e);
145
+ if(!options.continue) {
146
+ process.exit(-1);
147
+ }
145
148
  }
146
149
  })
147
150
  .parse(process.argv);
package/src/publish.mjs CHANGED
@@ -24,15 +24,15 @@ export async function publish(fileName, destination, properties) {
24
24
 
25
25
  publish.url = publish.url + "/" + basename(fileName);
26
26
 
27
- console.log(publish.url);
27
+ console.log(`Publishing to ${publish.url}`);
28
28
 
29
29
  if (publish.scheme === "http:" || publish.scheme === "https:") {
30
30
  const headers = {};
31
31
 
32
- if (publish.username) {
32
+ if (publish.user) {
33
33
  headers.authorization =
34
34
  "Basic " +
35
- Buffer.from(publish.username + ":" + publish.password).toString(
35
+ Buffer.from(publish.user + ":" + publish.password).toString(
36
36
  "base64"
37
37
  );
38
38
  }
@@ -43,9 +43,9 @@ export async function publish(fileName, destination, properties) {
43
43
  body: createReadStream(fileName)
44
44
  });
45
45
 
46
- console.log(response);
47
-
48
- return;
46
+ if(!response.ok) {
47
+ throw new Error(`Unable to publish to ${publish.url}: ${response.statusText}(${response.statusCode})`);
48
+ }
49
49
  }
50
50
 
51
51
  /*