repo-util 1.14.7 → 1.15.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 +5 -5
- package/src/repo-util-cli.mjs +21 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repo-util",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 2m tests/*.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"aggregation-repository-provider": "^5.0.
|
|
25
|
-
"bitbucket-repository-provider": "^4.1.
|
|
24
|
+
"aggregation-repository-provider": "^5.0.5",
|
|
25
|
+
"bitbucket-repository-provider": "^4.1.4",
|
|
26
26
|
"commander": "^9.2.0",
|
|
27
|
-
"gitea-repository-provider": "^2.1.
|
|
28
|
-
"github-repository-provider": "^7.26.
|
|
27
|
+
"gitea-repository-provider": "^2.1.30",
|
|
28
|
+
"github-repository-provider": "^7.26.20",
|
|
29
29
|
"local-repository-provider": "^8.0.3"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
package/src/repo-util-cli.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { readFileSync } from "fs";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
4
5
|
import { program, Option } from "commander";
|
|
5
6
|
import AggregationProvider from "aggregation-repository-provider";
|
|
6
7
|
|
|
@@ -8,7 +9,7 @@ process.on("uncaughtException", console.error);
|
|
|
8
9
|
process.on("unhandledRejection", console.error);
|
|
9
10
|
|
|
10
11
|
const { version, description } = JSON.parse(
|
|
11
|
-
readFileSync(new URL("../package.json", import.meta.url)
|
|
12
|
+
readFileSync(fileURLToPath(new URL("../package.json", import.meta.url)), {
|
|
12
13
|
encoding: "utf8"
|
|
13
14
|
})
|
|
14
15
|
);
|
|
@@ -25,7 +26,11 @@ program
|
|
|
25
26
|
);
|
|
26
27
|
|
|
27
28
|
for (const o of [
|
|
28
|
-
[
|
|
29
|
+
[
|
|
30
|
+
"provider",
|
|
31
|
+
"providers",
|
|
32
|
+
["name", ...Object.keys(visibleAttributes(AggregationProvider))]
|
|
33
|
+
],
|
|
29
34
|
["group", "repositoryGroups", ["fullName"]],
|
|
30
35
|
["repository", "repositories", ["fullName"]],
|
|
31
36
|
["branch", "branches", ["fullName"]],
|
|
@@ -115,12 +120,19 @@ async function list(provider, names, options, slot, attributes, actions) {
|
|
|
115
120
|
value = value.join(" ");
|
|
116
121
|
} else if (value instanceof Set) {
|
|
117
122
|
value = [...value].join(" ");
|
|
123
|
+
} else if (value === undefined) {
|
|
124
|
+
value = "";
|
|
118
125
|
}
|
|
119
126
|
|
|
120
127
|
if (options.identifier === false) {
|
|
121
128
|
console.log(value);
|
|
122
129
|
} else {
|
|
123
|
-
console.log(
|
|
130
|
+
console.log(
|
|
131
|
+
attributes.indexOf(a) === 0
|
|
132
|
+
? object.fullName + ":"
|
|
133
|
+
: " ".substring(a.length) + a + ":",
|
|
134
|
+
value
|
|
135
|
+
);
|
|
124
136
|
}
|
|
125
137
|
}
|
|
126
138
|
}
|
|
@@ -148,3 +160,9 @@ async function prepareProvider(options) {
|
|
|
148
160
|
|
|
149
161
|
return provider;
|
|
150
162
|
}
|
|
163
|
+
|
|
164
|
+
function visibleAttributes(object) {
|
|
165
|
+
return Object.fromEntries(
|
|
166
|
+
Object.entries(object.attributes).filter(([k, v]) => k!=="name" && !v.private)
|
|
167
|
+
);
|
|
168
|
+
}
|