npm-pkgbuild 7.3.4 → 7.3.5
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 +1 -1
- package/src/npm-pkgbuild-cli.mjs +2 -2
- package/src/output/deb.mjs +1 -1
- package/src/output/pkg.mjs +17 -5
package/package.json
CHANGED
package/src/npm-pkgbuild-cli.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import program from "commander";
|
|
|
7
7
|
import { aggregateFifo } from "aggregate-async-iterator";
|
|
8
8
|
import { packageDirectory } from "pkg-dir";
|
|
9
9
|
import { utf8StreamOptions, extractFromPackage } from "./util.mjs";
|
|
10
|
-
import { FileContentProvider,
|
|
10
|
+
import { FileContentProvider, DEB, PKG, RPM } from "npm-pkgbuild";
|
|
11
11
|
|
|
12
12
|
const { version, description } = JSON.parse(
|
|
13
13
|
readFileSync(new URL("../package.json", import.meta.url).pathname),
|
|
@@ -16,7 +16,7 @@ const { version, description } = JSON.parse(
|
|
|
16
16
|
|
|
17
17
|
const cwd = process.cwd();
|
|
18
18
|
|
|
19
|
-
const outputs = [
|
|
19
|
+
const outputs = [DEB, PKG, RPM];
|
|
20
20
|
|
|
21
21
|
program.description(description).version(version);
|
|
22
22
|
|
package/src/output/deb.mjs
CHANGED
package/src/output/pkg.mjs
CHANGED
|
@@ -1,24 +1,36 @@
|
|
|
1
1
|
import { join, dirname } from "path";
|
|
2
|
+
import { createWriteStream } from "fs";
|
|
2
3
|
import { tmpdir } from "os";
|
|
3
4
|
import { finished } from "stream";
|
|
4
5
|
import { promisify } from "util";
|
|
5
6
|
import { mkdtemp, mkdir, chmod } from "fs/promises";
|
|
6
|
-
import {
|
|
7
|
+
import { execa } from "execa";
|
|
7
8
|
import { Packager } from "./packager.mjs";
|
|
8
9
|
import { quote } from "../util.mjs";
|
|
9
10
|
|
|
10
11
|
export class PKG extends Packager {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
static get name() {
|
|
13
|
+
return "pkg";
|
|
14
|
+
}
|
|
13
15
|
|
|
14
16
|
static get fileNameExtension() {
|
|
15
17
|
return ".pkg.tar";
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
async execute() {
|
|
19
|
-
|
|
20
|
+
async execute(options) {
|
|
20
21
|
const tmp = await mkdtemp(join(tmpdir(), "pkg-"));
|
|
21
22
|
|
|
23
|
+
const pkgbuild = join(tmp, "PKGBUILD");
|
|
24
|
+
|
|
25
|
+
console.log(pkgbuild);
|
|
26
|
+
|
|
27
|
+
const out = createWriteStream(pkgbuild, { encoding: "utf8" });
|
|
28
|
+
out.write(`
|
|
29
|
+
package() {
|
|
30
|
+
cp -r $srcdir/* "$pkgdir"
|
|
31
|
+
}
|
|
32
|
+
`);
|
|
33
|
+
|
|
22
34
|
await execa("makepkg", [], { cwd: tmp });
|
|
23
35
|
}
|
|
24
36
|
}
|