repo-util 1.10.3 → 1.10.4
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 +6 -6
- package/src/repo-util-cli.mjs +8 -33
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repo-util",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,12 +21,12 @@
|
|
|
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": "^4.0.
|
|
25
|
-
"bitbucket-repository-provider": "^3.9.
|
|
24
|
+
"aggregation-repository-provider": "^4.0.1",
|
|
25
|
+
"bitbucket-repository-provider": "^3.9.9",
|
|
26
26
|
"commander": "^8.3.0",
|
|
27
|
-
"gitea-repository-provider": "^1.16.
|
|
28
|
-
"github-repository-provider": "^7.23.
|
|
29
|
-
"local-repository-provider": "^7.0.
|
|
27
|
+
"gitea-repository-provider": "^1.16.34",
|
|
28
|
+
"github-repository-provider": "^7.23.32",
|
|
29
|
+
"local-repository-provider": "^7.0.106"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"ava": "^3.15.0",
|
package/src/repo-util-cli.mjs
CHANGED
|
@@ -36,8 +36,9 @@ program
|
|
|
36
36
|
for (const o of [
|
|
37
37
|
["provider", "providers", ["name"]],
|
|
38
38
|
["repository-group", "repositoryGroups", ["name"]],
|
|
39
|
-
["repository", "repositories", ["
|
|
40
|
-
["branch", "branches", ["fullName"]]
|
|
39
|
+
["repository", "repositories", ["fullName"]],
|
|
40
|
+
["branch", "branches", ["fullName"]],
|
|
41
|
+
["hook", "hooks", ["url"]]
|
|
41
42
|
]) {
|
|
42
43
|
program
|
|
43
44
|
.command(`${o[0]} <name...>`)
|
|
@@ -54,36 +55,6 @@ for (const o of [
|
|
|
54
55
|
);
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
program
|
|
58
|
-
.command("hooks <name...>")
|
|
59
|
-
.option("--json", "output as json")
|
|
60
|
-
.action(async (names, options) => {
|
|
61
|
-
const provider = await prepareProvider();
|
|
62
|
-
|
|
63
|
-
if (options.json) {
|
|
64
|
-
const json = [];
|
|
65
|
-
|
|
66
|
-
for await (const repository of provider.repositories(names)) {
|
|
67
|
-
const r = { name: repository.fullName, hooks: [] };
|
|
68
|
-
for await (const hook of repository.hooks()) {
|
|
69
|
-
r.hooks.push(hook);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (r.hooks.length > 0) {
|
|
73
|
-
json.push(r);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
console.log(JSON.stringify(json));
|
|
77
|
-
} else {
|
|
78
|
-
for await (const repository of provider.repositories(names)) {
|
|
79
|
-
for await (const hook of repository.hooks()) {
|
|
80
|
-
console.log(repository.fullName);
|
|
81
|
-
console.log(" " + hook.url);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
|
|
87
58
|
program
|
|
88
59
|
.command("pull-request <name...>")
|
|
89
60
|
.option("--json", "output as json")
|
|
@@ -145,8 +116,12 @@ async function list(provider, name, options, slot, attributes) {
|
|
|
145
116
|
console.log(JSON.stringify(json));
|
|
146
117
|
} else {
|
|
147
118
|
for await (const object of provider[slot](name)) {
|
|
119
|
+
let prefix= "";
|
|
120
|
+
if(object.repository) {
|
|
121
|
+
prefix = object.repository.fullName + ": ";
|
|
122
|
+
}
|
|
148
123
|
for (const a of attributes) {
|
|
149
|
-
console.log(object[a]);
|
|
124
|
+
console.log(prefix,object[a]);
|
|
150
125
|
}
|
|
151
126
|
}
|
|
152
127
|
}
|