npm-pkgbuild 7.11.13 → 7.11.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/output/arch.mjs +21 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "7.11.13",
3
+ "version": "7.11.14",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -58,6 +58,9 @@ export class ARCH extends Packager {
58
58
  if (properties.source) {
59
59
  properties.md5sums = ["SKIP"];
60
60
  }
61
+ if (properties.hooks) {
62
+ properties.install = `${properties.name}.install`;
63
+ }
61
64
 
62
65
  const staging = await this.tmpdir;
63
66
 
@@ -76,31 +79,12 @@ package() {
76
79
  `;
77
80
  }
78
81
 
79
- const fp = fieldProvider(properties, fields);
80
-
81
- transformer.push({
82
- match: entry => entry.name === "PKGBUILD",
83
- transform: async entry =>
84
- new ReadableStreamContentEntry(
85
- entry.name,
86
- keyValueTransformer(await entry.readStream, fp, {
87
- ...pkgKeyValuePairOptions,
88
- trailingLines
89
- })
90
- ),
91
- createEntryWhenMissing: () => new EmptyContentEntry("PKGBUILD")
92
- });
93
-
94
82
  if (properties.hooks) {
95
83
  async function* transformer(expression, remainder, source, cb) {
96
84
  const value = properties[expression];
97
85
  yield value === undefined ? "" : value;
98
86
  }
99
87
 
100
- const destination = join(staging, properties.hooks);
101
-
102
- await mkdir(dirname(destination), { recursive: true });
103
-
104
88
  await pipeline(
105
89
  iterableStringInterceptor(
106
90
  createReadStream(
@@ -109,13 +93,28 @@ package() {
109
93
  ),
110
94
  transformer
111
95
  ),
112
- createWriteStream(destination, utf8StreamOptions)
96
+ createWriteStream(join(staging, properties.install), utf8StreamOptions)
113
97
  );
114
98
  }
115
99
 
100
+ const fp = fieldProvider(properties, fields);
101
+
102
+ transformer.push({
103
+ match: entry => entry.name === "PKGBUILD",
104
+ transform: async entry =>
105
+ new ReadableStreamContentEntry(
106
+ "../" + entry.name,
107
+ keyValueTransformer(await entry.readStream, fp, {
108
+ ...pkgKeyValuePairOptions,
109
+ trailingLines
110
+ })
111
+ ),
112
+ createEntryWhenMissing: () => new EmptyContentEntry("PKGBUILD")
113
+ });
114
+
116
115
  for await (const file of copyEntries(
117
116
  transform(sources, transformer, true),
118
- staging,
117
+ join(staging,'src'),
119
118
  expander
120
119
  )) {
121
120
  if (options.verbose) {
@@ -154,7 +153,7 @@ const fields = {
154
153
  pkgdesc: { alias: "description", type: "string", mandatory: true },
155
154
  url: { alias: "homepage", type: "string" },
156
155
  license: { type: "string[]", mandatory: true },
157
- install: { alias: "hooks", type: "string" },
156
+ install: { type: "string" },
158
157
  changelog: { type: "string" },
159
158
  source: { type: "string[]" },
160
159
  validpgpkeys: { type: "string[]" },