npm-pkgbuild 11.2.0 → 11.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/output/rpm.mjs +10 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "11.2.0",
3
+ "version": "11.2.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -80,9 +80,13 @@ export class RPM extends Packager {
80
80
  * Check for rpmbuild presence.
81
81
  * @returns {boolean} true when rpmbuild is present
82
82
  */
83
- static async prepare() {
83
+ static async prepare(options, variant) {
84
84
  try {
85
85
  await execa("rpmbuild", ["--version"]);
86
+ if (variant?.arch) {
87
+ const uname = await execa("uname", ["-m"]);
88
+ return uname.stdout.match(variant.arch);
89
+ }
86
90
  return true;
87
91
  } catch {}
88
92
 
@@ -184,10 +188,13 @@ export class RPM extends Packager {
184
188
  }
185
189
 
186
190
  await cp(
187
- join(tmpdir, "RPMS",
191
+ join(
192
+ tmpdir,
193
+ "RPMS",
188
194
  // TODO handle arrays ?
189
195
  Array.isArray(properties.arch) ? properties.arch[0] : properties.arch,
190
- this.packageFileName),
196
+ this.packageFileName
197
+ ),
191
198
  packageFile,
192
199
  { preserveTimestamps: true }
193
200
  );