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 CHANGED
@@ -240,18 +240,22 @@ endif
240
240
 
241
241
  :Fetch remote branches;
242
242
  :Fetch pull requests;
243
- :Create label;
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 exists) then (yes)
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/svg/RP3DReCm48Jl-nHpX4DU85nILMgFZIhr0HpO1AiBTkrrVzw-E3W4f5pusLcFlvb3L1Cq3KBN3xe4bpm6OqVQlxB29UsCSWTlsazpuTWGsJEg9v5b11COoU_KxV9k3UrvHFN7iIQ0nuvO8gCQNKtJdpqJxLzOsnw11wUCKp1ZssVlClT9P1A_4aVDq-V0HXbYJYmD5SYtWdOi6CVWMexH1VhfhJ2g8e1_xMHJmyO5wg73tG386T_NT8lBDjmI300APpdHpBCFd--ubTLi5jSvRuguo73IRKieQaRwNbymztbzpw5omoL_ngAxG9iTEaoFDCW_)](http://www.plantuml.com/plantuml/uml/RP3DReCm48Jl-nHpX4DU85nILMgFZIhr0HpO1AiBTkrrVzw-E3W4f5pusLcFlvb3L1Cq3KBN3xe4bpm6OqVQlxB29UsCSWTlsazpuTWGsJEg9v5b11COoU_KxV9k3UrvHFN7iIQ0nuvO8gCQNKtJdpqJxLzOsnw11wUCKp1ZssVlClT9P1A_4aVDq-V0HXbYJYmD5SYtWdOi6CVWMexH1VhfhJ2g8e1_xMHJmyO5wg73tG386T_NT8lBDjmI300APpdHpBCFd--ubTLi5jSvRuguo73IRKieQaRwNbymztbzpw5omoL_ngAxG9iTEaoFDCW_)
271
+ [![](http://www.plantuml.com/plantuml/svg/VL1BJiCm4DtFATuoMVG2pQO82JP8L4WSm4scJSGa3fundzjJrqsJ5iJ6dtbFypuRDHSizaAd1ns2ZoDwrmsqVcI3ZzOuumQZgz_SWRKYwlOexaGk8xZ0YEFA_2fnIrZB0uflrf807XfYKKOn-9AElsvFj7vWgri4xhqnTi4DTSjQJVCnYY3mUsIrIV79xLZGU5OCti1VdTgDrFe-i3E696hrMpM7Upv7sfxjRuElMTK7-cmxOHHd84jeYKul2dzkc1S0oUdBCjN_ZcVFcLtbsUkOzay5LrV4PJSJ8buPNfgRuZAQx7mi1UPUW5Cp-SxXKbUd7ZA3Pe2kEBGv7h6N7m00)](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
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.app = void 0;
4
4
  exports.app = {
5
5
  name: 'npm-update-package',
6
- version: '0.28.1',
6
+ version: '0.28.2',
7
7
  web: 'https://github.com/npm-update-package/npm-update-package'
8
8
  };
@@ -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
- await this.github.createLabel({
23
- owner: this.gitRepo.owner,
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.28.1",
3
+ "version": "0.28.2",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",