repo-util 1.20.0 → 1.20.1

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.20.0",
3
+ "version": "1.20.1",
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.2.26",
25
- "bitbucket-repository-provider": "^4.1.24",
24
+ "aggregation-repository-provider": "^5.2.28",
25
+ "bitbucket-repository-provider": "^4.1.26",
26
26
  "commander": "^9.2.0",
27
- "gitea-repository-provider": "^2.1.57",
28
- "github-repository-provider": "^7.29.2",
27
+ "gitea-repository-provider": "^2.1.60",
28
+ "github-repository-provider": "^7.29.6",
29
29
  "local-repository-provider": "^8.0.11"
30
30
  },
31
31
  "devDependencies": {
@@ -139,36 +139,29 @@ async function list(provider, names, options, slot, attributes, actions) {
139
139
  }
140
140
  }
141
141
  }
142
- // modify
143
- if (Object.keys(properties).length > 0) {
144
- for (const [k, v] of Object.entries(properties)) {
145
- object[k] = v;
146
- }
147
- await object.update();
142
+
143
+ if (options.json) {
144
+ json.push(object);
148
145
  } else {
149
- if (options.json) {
150
- json.push(object);
151
- } else {
152
- for (const a of attributes) {
153
- let value = object[a];
154
- if (Array.isArray(value)) {
155
- value = value.join(" ");
156
- } else if (value instanceof Set) {
157
- value = [...value].join(" ");
158
- } else if (value === undefined) {
159
- value = "";
160
- }
146
+ for (const a of attributes) {
147
+ let value = object[a];
148
+ if (Array.isArray(value)) {
149
+ value = value.join(" ");
150
+ } else if (value instanceof Set) {
151
+ value = [...value].join(" ");
152
+ } else if (value === undefined) {
153
+ value = "";
154
+ }
161
155
 
162
- if (options.identifier === false) {
163
- console.log(value);
164
- } else {
165
- console.log(
166
- attributes.indexOf(a) === 0
167
- ? object.fullName + ":"
168
- : " ".substring(a.length) + a + ":",
169
- value
170
- );
171
- }
156
+ if (options.identifier === false) {
157
+ console.log(value);
158
+ } else {
159
+ console.log(
160
+ attributes.indexOf(a) === 0
161
+ ? object.fullName + ":"
162
+ : " ".substring(a.length) + a + ":",
163
+ value
164
+ );
172
165
  }
173
166
  }
174
167
  }
@@ -212,7 +205,13 @@ function type(clazz, extra) {
212
205
  {
213
206
  update: {
214
207
  description: `update ${clazz.type} attributes`,
215
- executeInstance: object => object.update(properties)
208
+ executeInstance: object => {
209
+ for (const [k, v] of Object.entries(properties)) {
210
+ object[k] = v;
211
+ }
212
+
213
+ object.update();
214
+ }
216
215
  },
217
216
  ...extra
218
217
  }