npm-update-package 0.28.1 → 0.28.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/README.md +8 -4
- package/dist/app.js +1 -1
- package/dist/github/label/creator/LabelCreator.js +18 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -240,18 +240,22 @@ endif
|
|
|
240
240
|
|
|
241
241
|
:Fetch remote branches;
|
|
242
242
|
:Fetch pull requests;
|
|
243
|
-
|
|
243
|
+
|
|
244
|
+
if (Label does not exist) then (yes)
|
|
245
|
+
:Create label;
|
|
246
|
+
else (no)
|
|
247
|
+
endif
|
|
244
248
|
|
|
245
249
|
group OutdatedPackagesProcessor
|
|
246
250
|
while (Package exists) is (yes)
|
|
247
251
|
group OutdatedPackageProcessor
|
|
248
|
-
if (Remote branch
|
|
249
|
-
else (no)
|
|
252
|
+
if (Remote branch does not exist) then (yes)
|
|
250
253
|
:Create branch;
|
|
251
254
|
:Update package;
|
|
252
255
|
:Create pull request;
|
|
253
256
|
:Close old pull requests;
|
|
254
257
|
:Remove branch;
|
|
258
|
+
else (no)
|
|
255
259
|
endif
|
|
256
260
|
end group
|
|
257
261
|
endwhile (no)
|
|
@@ -264,7 +268,7 @@ end
|
|
|
264
268
|
```
|
|
265
269
|
-->
|
|
266
270
|
|
|
267
|
-
[](http://www.plantuml.com/plantuml/uml/VL1BJiCm4DtFATuoMVG2pQO82JP8L4WSm4scJSGa3fundzjJrqsJ5iJ6dtbFypuRDHSizaAd1ns2ZoDwrmsqVcI3ZzOuumQZgz_SWRKYwlOexaGk8xZ0YEFA_2fnIrZB0uflrf807XfYKKOn-9AElsvFj7vWgri4xhqnTi4DTSjQJVCnYY3mUsIrIV79xLZGU5OCti1VdTgDrFe-i3E696hrMpM7Upv7sfxjRuElMTK7-cmxOHHd84jeYKul2dzkc1S0oUdBCjN_ZcVFcLtbsUkOzay5LrV4PJSJ8buPNfgRuZAQx7mi1UPUW5Cp-SxXKbUd7ZA3Pe2kEBGv7h6N7m00)
|
|
268
272
|
|
|
269
273
|
## FAQ
|
|
270
274
|
|
package/dist/app.js
CHANGED
|
@@ -10,8 +10,23 @@ class LabelCreator {
|
|
|
10
10
|
this.logger = logger;
|
|
11
11
|
}
|
|
12
12
|
async create({ name, description, color }) {
|
|
13
|
+
const label = await this.fetchLabel(name);
|
|
14
|
+
if (label !== undefined) {
|
|
15
|
+
this.logger.info(`Skip creating ${name} label because it already exists.`);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
await this.github.createLabel({
|
|
19
|
+
owner: this.gitRepo.owner,
|
|
20
|
+
repo: this.gitRepo.name,
|
|
21
|
+
name,
|
|
22
|
+
description,
|
|
23
|
+
color
|
|
24
|
+
});
|
|
25
|
+
this.logger.info(`${name} label has created.`);
|
|
26
|
+
}
|
|
27
|
+
async fetchLabel(name) {
|
|
13
28
|
try {
|
|
14
|
-
await this.github.fetchLabel({
|
|
29
|
+
return await this.github.fetchLabel({
|
|
15
30
|
owner: this.gitRepo.owner,
|
|
16
31
|
repo: this.gitRepo.name,
|
|
17
32
|
name
|
|
@@ -19,14 +34,8 @@ class LabelCreator {
|
|
|
19
34
|
}
|
|
20
35
|
catch (e) {
|
|
21
36
|
if ((0, errors_1.isNotFoundError)(e)) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
repo: this.gitRepo.name,
|
|
25
|
-
name,
|
|
26
|
-
description,
|
|
27
|
-
color
|
|
28
|
-
});
|
|
29
|
-
this.logger.info(`${name} label has created.`);
|
|
37
|
+
this.logger.warn(e);
|
|
38
|
+
return undefined;
|
|
30
39
|
}
|
|
31
40
|
else {
|
|
32
41
|
throw e;
|