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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "7.3.4",
3
+ "version": "7.3.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -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, Deb, PKG, RPM } from "npm-pkgbuild";
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 = [Deb, PKG, RPM];
19
+ const outputs = [DEB, PKG, RPM];
20
20
 
21
21
  program.description(description).version(version);
22
22
 
@@ -17,7 +17,7 @@ const permissions = {
17
17
  "DEBIAN/postrm": executableAttributes
18
18
  };
19
19
 
20
- export class Deb extends Packager {
20
+ export class DEB extends Packager {
21
21
  static get name() {
22
22
  return "deb";
23
23
  }
@@ -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 { execa } from "execa";
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
- static get name() { return "pkg"; }
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
  }