npm-pkgbuild 8.2.3 → 8.3.2
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 +2 -2
- package/src/npm-pkgbuild-cli.mjs +5 -2
- package/src/output/rpm.mjs +11 -6
- package/src/publish.mjs +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "8.2
|
|
3
|
+
"version": "8.3.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"expression-expander": "^7.0.16",
|
|
51
51
|
"globby": "^13.1.0",
|
|
52
52
|
"ini": "^2.0.0",
|
|
53
|
-
"iterable-string-interceptor": "^1.0.
|
|
53
|
+
"iterable-string-interceptor": "^1.0.15",
|
|
54
54
|
"key-value-transformer": "^2.1.1",
|
|
55
55
|
"node-fetch": "^3.2.3",
|
|
56
56
|
"npm-package-walker": "^5.0.6",
|
package/src/npm-pkgbuild-cli.mjs
CHANGED
|
@@ -36,6 +36,7 @@ program
|
|
|
36
36
|
)
|
|
37
37
|
.option("-p --pkgdir <dir>", "which package to use", process.cwd())
|
|
38
38
|
.option("-a --available", "only excute availabe output methods", false)
|
|
39
|
+
.option("--continue", "continue on error")
|
|
39
40
|
.option(
|
|
40
41
|
"-c --content <dir>",
|
|
41
42
|
"content directory",
|
|
@@ -140,8 +141,10 @@ program
|
|
|
140
141
|
await publish(fileName, options.publish, properties);
|
|
141
142
|
}
|
|
142
143
|
} catch (e) {
|
|
143
|
-
console.
|
|
144
|
-
|
|
144
|
+
console.error(e);
|
|
145
|
+
if(!options.continue) {
|
|
146
|
+
process.exit(-1);
|
|
147
|
+
}
|
|
145
148
|
}
|
|
146
149
|
})
|
|
147
150
|
.parse(process.argv);
|
package/src/output/rpm.mjs
CHANGED
|
@@ -31,6 +31,16 @@ const hookMapping = {
|
|
|
31
31
|
post_upgrade:*/
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
export function requiresFromDependencies(dependencies)
|
|
35
|
+
{
|
|
36
|
+
return Object.entries(dependencies).map(
|
|
37
|
+
([name, e]) =>
|
|
38
|
+
`${
|
|
39
|
+
packageNameMapping[name] ? packageNameMapping[name] : name
|
|
40
|
+
} ${e.replace(/([<=>])(\d)/, (match, p1,p2) => `${p1} ${p2}`)}`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
34
44
|
export class RPM extends Packager {
|
|
35
45
|
static get name() {
|
|
36
46
|
return "rpm";
|
|
@@ -75,12 +85,7 @@ export class RPM extends Packager {
|
|
|
75
85
|
const { properties, tmpdir, staging, destination } =
|
|
76
86
|
await this.prepareExecute(options);
|
|
77
87
|
|
|
78
|
-
properties.Requires =
|
|
79
|
-
([name, e]) =>
|
|
80
|
-
`${
|
|
81
|
-
packageNameMapping[name] ? packageNameMapping[name] : name
|
|
82
|
-
} ${e.replace(/([<=>])\d/, (match, p1) => `${p1} `)}`
|
|
83
|
-
);
|
|
88
|
+
properties.Requires = requiresFromDependencies(dependencies);
|
|
84
89
|
|
|
85
90
|
const specFileName = `${properties.name}.spec`;
|
|
86
91
|
|
package/src/publish.mjs
CHANGED
|
@@ -24,7 +24,7 @@ export async function publish(fileName, destination, properties) {
|
|
|
24
24
|
|
|
25
25
|
publish.url = publish.url + "/" + basename(fileName);
|
|
26
26
|
|
|
27
|
-
console.log(publish.url);
|
|
27
|
+
console.log(`Publishing to ${publish.url}`);
|
|
28
28
|
|
|
29
29
|
if (publish.scheme === "http:" || publish.scheme === "https:") {
|
|
30
30
|
const headers = {};
|
|
@@ -43,9 +43,9 @@ export async function publish(fileName, destination, properties) {
|
|
|
43
43
|
body: createReadStream(fileName)
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
if(!response.ok) {
|
|
47
|
+
throw new Error(`Unable to publish to ${publish.url}: ${response.statusText}(${response.statusCode})`);
|
|
48
|
+
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/*
|