npm-pkgbuild 11.2.4 → 11.2.6

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": "11.2.4",
3
+ "version": "11.2.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -75,7 +75,7 @@ export class ARCH extends Packager {
75
75
  return fields;
76
76
  }
77
77
 
78
- static async prepare(options, variant) {
78
+ static async prepare(options={}, variant={}) {
79
79
  if (_prepared === undefined) {
80
80
  try {
81
81
  await execa("makepkg", ["-V"]);
@@ -92,18 +92,21 @@ export class ARCH extends Packager {
92
92
  .substring(i)
93
93
  .split(/\n/)[0]
94
94
  .match(/='([^'"]+)['"]/);
95
- return m[1];
95
+ return m && m[1];
96
96
  }
97
97
  }
98
98
  _ext = getValue("PKGEXT");
99
99
  _architecture = getValue("CARCH");
100
100
  _prepared = true;
101
- } catch {
101
+ } catch(e) {
102
102
  _prepared = false;
103
103
  }
104
104
  }
105
- return _prepared && !variant || variant.arch === _architecture;
106
- }
105
+ // console.log("ARCH", variant.arch, _architecture,
106
+ // _prepared, (variant.arch === undefined || variant.arch === _architecture));
107
+
108
+ return _prepared && (variant.arch === undefined || variant.arch === _architecture);
109
+ }
107
110
 
108
111
  get packageFileName() {
109
112
  const p = this.properties;