npm-pkgbuild 9.0.3 → 9.0.4

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/README.md CHANGED
@@ -18,11 +18,18 @@ Create ArchLinux, RPM and Debian packages from npm packages.
18
18
  In a package directory execute
19
19
 
20
20
  ```shell
21
- npm-pkgbuild --rpm --debian --arch --content build
21
+ npm-pkgbuild --rpm --debian --arch --content build --publish /some/directory
22
22
  ```
23
23
 
24
24
  This will create a arch, rpm and a debian package of the build dir.
25
25
 
26
+
27
+ ## upload package
28
+
29
+ ```shell
30
+ npm-pkgbuild --rpm --debian --arch --content build --publish 'https://my.package-service.com/binaries/linux/{{type}}/{{access}}/{{arch}}'
31
+ ```
32
+
26
33
  You can specify the package content in package.json.
27
34
 
28
35
  ```json
@@ -77,6 +84,7 @@ options:
77
84
  ### Table of Contents
78
85
 
79
86
  - [usage](#usage)
87
+ - [upload package](#upload-package)
80
88
  - [content providers](#content-providers)
81
89
  - [files (default)](#files-default)
82
90
  - [npm-pack](#npm-pack)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "9.0.3",
3
+ "version": "9.0.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { readFileSync } from "fs";
4
+ import { fileURLToPath } from "url";
4
5
  import { readFile } from "fs/promises";
5
6
  import { join } from "path";
6
7
  import { program } from "commander";
@@ -20,8 +21,10 @@ import {
20
21
  } from "npm-pkgbuild";
21
22
 
22
23
  const { version, description } = JSON.parse(
23
- readFileSync(new URL("../package.json", import.meta.url).pathname),
24
- utf8StreamOptions
24
+ readFileSync(
25
+ fileURLToPath(new URL("../package.json", import.meta.url)),
26
+ utf8StreamOptions
27
+ )
25
28
  );
26
29
 
27
30
  program.description(description).version(version);
@@ -45,13 +48,20 @@ program
45
48
  )
46
49
  .option("-m --meta <dir>", "meta directory", (c, a) => a.concat([c]), [])
47
50
  .addOption(
48
- new program.Option("--publish <url>", "publishing url of the package")
51
+ new program.Option(
52
+ "--publish <url>",
53
+ "publishing url (or directory) of the package"
54
+ )
49
55
  .env("PKGBUILD_PUBLISH")
50
56
  .argParser(value => {
51
57
  let values = value.split(/,/);
52
58
  if (values.length > 1) {
53
59
  values = values.map(v => process.env[v] || v);
54
- return { url: values[0], user: values[1], password: decodePassword(values[2]) };
60
+ return {
61
+ url: values[0],
62
+ user: values[1],
63
+ password: decodePassword(values[2])
64
+ };
55
65
  }
56
66
 
57
67
  return { url: value };
@@ -135,7 +145,7 @@ program
135
145
  }
136
146
  } catch (e) {
137
147
  console.error(e);
138
- if(!options.continue) {
148
+ if (!options.continue) {
139
149
  process.exit(-1);
140
150
  }
141
151
  }