repo-util 1.24.75 → 1.24.77

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": "repo-util",
3
- "version": "1.24.75",
3
+ "version": "1.24.77",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "aggregation-repository-provider": "^5.3.20",
25
- "bitbucket-repository-provider": "^4.4.29",
25
+ "bitbucket-repository-provider": "^4.4.30",
26
26
  "commander": "^9.4.1",
27
27
  "etag-cache-leveldb": "^1.4.1",
28
- "gitea-repository-provider": "^2.4.31",
29
- "github-repository-provider": "^7.33.31",
28
+ "gitea-repository-provider": "^2.4.33",
29
+ "github-repository-provider": "^7.33.34",
30
30
  "leveldown": "^6.1.1",
31
31
  "levelup": "^5.1.1",
32
32
  "local-repository-provider": "^8.1.9",
@@ -14,9 +14,13 @@ import {
14
14
  MultiGroupProvider
15
15
  } from "repository-provider";
16
16
  import pkg from "../package.json" assert { type: "json" };
17
- import { initializeRepositoryProvider, initializeCommandLine } from "./setup-provider.mjs";
17
+ import {
18
+ initializeRepositoryProvider,
19
+ initializeCommandLine
20
+ } from "./setup-provider.mjs";
18
21
 
19
22
  const properties = {};
23
+ let action;
20
24
 
21
25
  initializeCommandLine(program);
22
26
 
@@ -85,14 +89,7 @@ for (const t of [
85
89
 
86
90
  const actions = t.actions;
87
91
 
88
- command.action(async (names, options) =>
89
- list(
90
- provider,
91
- names,
92
- t,
93
- actions
94
- )
95
- );
92
+ command.action(async (names, options) => list(provider, names, t, actions));
96
93
 
97
94
  if (actions) {
98
95
  for (const [an, actionOptions] of Object.entries(actions)) {
@@ -100,13 +97,16 @@ for (const t of [
100
97
  const command = program.command(
101
98
  `${t.name}-${an} ${actionOptions.suffix}`
102
99
  );
103
-
104
100
  command.action(async (names, options) => {
105
101
  await actionOptions.execute(provider, names, options);
106
102
  });
107
103
  }
108
104
  if (actionOptions.executeInstance) {
109
- command.option(`--${an}`, actionOptions.description);
105
+ command.option(
106
+ `--${an}`,
107
+ actionOptions.description,
108
+ () => (action = an)
109
+ );
110
110
  }
111
111
  }
112
112
  }
@@ -154,11 +154,10 @@ async function list(provider, names, type, actions) {
154
154
  const json = [];
155
155
 
156
156
  for await (const object of provider[type.collectionName](normalize(names))) {
157
- if (actions) {
158
- for (const [name, action] of Object.entries(actions)) {
159
- if (options[name] && action.executeInstance) {
160
- await action.executeInstance(object, options);
161
- }
157
+ if (actions && action) {
158
+ const a = actions[action];
159
+ if (a?.executeInstance) {
160
+ await a.executeInstance(object, options);
162
161
  }
163
162
  }
164
163
 
@@ -199,11 +198,6 @@ function type(clazz, extra) {
199
198
  description: `update ${clazz.type} attributes`,
200
199
  executeInstance: async object => {
201
200
  Object.assign(object, properties);
202
-
203
- /*for (const [k, v] of Object.entries(properties)) {
204
- object[k] = v;
205
- }*/
206
-
207
201
  await object.update();
208
202
  }
209
203
  },