commitizen 4.3.1 → 5.0.0

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.
@@ -4,936 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _child_process = _interopRequireDefault(require("child_process"));
8
- var _path = _interopRequireDefault(require("path"));
7
+ var _nodeChild_process = _interopRequireDefault(require("node:child_process"));
8
+ var _nodePath = _interopRequireDefault(require("node:path"));
9
9
  var configLoader = _interopRequireWildcard(require("./configLoader"));
10
10
  var adapter = _interopRequireWildcard(require("./adapter"));
11
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- function cov_1ss29zpusr() {
15
- var path = "/home/runner/work/cz-cli/cz-cli/src/commitizen/init.js";
16
- var hash = "efe77f0db628ee432080465bad4470b265b5f217";
17
- var global = new Function("return this")();
18
- var gcv = "__coverage__";
19
- var coverageData = {
20
- path: "/home/runner/work/cz-cli/cz-cli/src/commitizen/init.js",
21
- statementMap: {
22
- "0": {
23
- start: {
24
- line: 10,
25
- column: 4
26
- },
27
- end: {
28
- line: 10,
29
- column: 11
30
- }
31
- },
32
- "1": {
33
- start: {
34
- line: 14,
35
- column: 17
36
- },
37
- end: {
38
- line: 14,
39
- column: 63
40
- }
41
- },
42
- "2": {
43
- start: {
44
- line: 33,
45
- column: 27
46
- },
47
- end: {
48
- line: 46,
49
- column: 1
50
- }
51
- },
52
- "3": {
53
- start: {
54
- line: 64,
55
- column: 2
56
- },
57
- end: {
58
- line: 64,
59
- column: 51
60
- }
61
- },
62
- "4": {
63
- start: {
64
- line: 67,
65
- column: 22
66
- },
67
- end: {
68
- line: 67,
69
- column: 49
70
- }
71
- },
72
- "5": {
73
- start: {
74
- line: 69,
75
- column: 25
76
- },
77
- end: {
78
- line: 69,
79
- column: 62
80
- }
81
- },
82
- "6": {
83
- start: {
84
- line: 72,
85
- column: 25
86
- },
87
- end: {
88
- line: 72,
89
- column: 107
90
- }
91
- },
92
- "7": {
93
- start: {
94
- line: 75,
95
- column: 32
96
- },
97
- end: {
98
- line: 75,
99
- column: 109
100
- }
101
- },
102
- "8": {
103
- start: {
104
- line: 77,
105
- column: 35
106
- },
107
- end: {
108
- line: 77,
109
- column: 110
110
- }
111
- },
112
- "9": {
113
- start: {
114
- line: 80,
115
- column: 2
116
- },
117
- end: {
118
- line: 88,
119
- column: 3
120
- }
121
- },
122
- "10": {
123
- start: {
124
- line: 81,
125
- column: 4
126
- },
127
- end: {
128
- line: 87,
129
- column: 7
130
- }
131
- },
132
- "11": {
133
- start: {
134
- line: 90,
135
- column: 2
136
- },
137
- end: {
138
- line: 98,
139
- column: 3
140
- }
141
- },
142
- "12": {
143
- start: {
144
- line: 91,
145
- column: 4
146
- },
147
- end: {
148
- line: 91,
149
- column: 68
150
- }
151
- },
152
- "13": {
153
- start: {
154
- line: 92,
155
- column: 4
156
- },
157
- end: {
158
- line: 94,
159
- column: 5
160
- }
161
- },
162
- "14": {
163
- start: {
164
- line: 93,
165
- column: 6
166
- },
167
- end: {
168
- line: 93,
169
- column: 73
170
- }
171
- },
172
- "15": {
173
- start: {
174
- line: 95,
175
- column: 4
176
- },
177
- end: {
178
- line: 95,
179
- column: 63
180
- }
181
- },
182
- "16": {
183
- start: {
184
- line: 97,
185
- column: 4
186
- },
187
- end: {
188
- line: 97,
189
- column: 21
190
- }
191
- },
192
- "17": {
193
- start: {
194
- line: 106,
195
- column: 2
196
- },
197
- end: {
198
- line: 108,
199
- column: 3
200
- }
201
- },
202
- "18": {
203
- start: {
204
- line: 107,
205
- column: 4
206
- },
207
- end: {
208
- line: 107,
209
- column: 59
210
- }
211
- },
212
- "19": {
213
- start: {
214
- line: 109,
215
- column: 2
216
- },
217
- end: {
218
- line: 111,
219
- column: 3
220
- }
221
- },
222
- "20": {
223
- start: {
224
- line: 110,
225
- column: 4
226
- },
227
- end: {
228
- line: 110,
229
- column: 77
230
- }
231
- },
232
- "21": {
233
- start: {
234
- line: 119,
235
- column: 15
236
- },
237
- end: {
238
- line: 119,
239
- column: 43
240
- }
241
- },
242
- "22": {
243
- start: {
244
- line: 120,
245
- column: 2
246
- },
247
- end: {
248
- line: 124,
249
- column: 3
250
- }
251
- },
252
- "23": {
253
- start: {
254
- line: 121,
255
- column: 4
256
- },
257
- end: {
258
- line: 121,
259
- column: 18
260
- }
261
- }
262
- },
263
- fnMap: {
264
- "0": {
265
- name: "init",
266
- decl: {
267
- start: {
268
- line: 51,
269
- column: 9
270
- },
271
- end: {
272
- line: 51,
273
- column: 13
274
- }
275
- },
276
- loc: {
277
- start: {
278
- line: 61,
279
- column: 24
280
- },
281
- end: {
282
- line: 99,
283
- column: 1
284
- }
285
- },
286
- line: 61
287
- },
288
- "1": {
289
- name: "checkRequiredArguments",
290
- decl: {
291
- start: {
292
- line: 105,
293
- column: 9
294
- },
295
- end: {
296
- line: 105,
297
- column: 31
298
- }
299
- },
300
- loc: {
301
- start: {
302
- line: 105,
303
- column: 55
304
- },
305
- end: {
306
- line: 112,
307
- column: 1
308
- }
309
- },
310
- line: 105
311
- },
312
- "2": {
313
- name: "loadAdapterConfig",
314
- decl: {
315
- start: {
316
- line: 118,
317
- column: 9
318
- },
319
- end: {
320
- line: 118,
321
- column: 26
322
- }
323
- },
324
- loc: {
325
- start: {
326
- line: 118,
327
- column: 33
328
- },
329
- end: {
330
- line: 125,
331
- column: 1
332
- }
333
- },
334
- line: 118
335
- }
336
- },
337
- branchMap: {
338
- "0": {
339
- loc: {
340
- start: {
341
- line: 51,
342
- column: 41
343
- },
344
- end: {
345
- line: 61,
346
- column: 22
347
- }
348
- },
349
- type: "default-arg",
350
- locations: [{
351
- start: {
352
- line: 61,
353
- column: 4
354
- },
355
- end: {
356
- line: 61,
357
- column: 22
358
- }
359
- }],
360
- line: 51
361
- },
362
- "1": {
363
- loc: {
364
- start: {
365
- line: 52,
366
- column: 2
367
- },
368
- end: {
369
- line: 52,
370
- column: 14
371
- }
372
- },
373
- type: "default-arg",
374
- locations: [{
375
- start: {
376
- line: 52,
377
- column: 9
378
- },
379
- end: {
380
- line: 52,
381
- column: 14
382
- }
383
- }],
384
- line: 52
385
- },
386
- "2": {
387
- loc: {
388
- start: {
389
- line: 53,
390
- column: 2
391
- },
392
- end: {
393
- line: 53,
394
- column: 16
395
- }
396
- },
397
- type: "default-arg",
398
- locations: [{
399
- start: {
400
- line: 53,
401
- column: 12
402
- },
403
- end: {
404
- line: 53,
405
- column: 16
406
- }
407
- }],
408
- line: 53
409
- },
410
- "3": {
411
- loc: {
412
- start: {
413
- line: 54,
414
- column: 2
415
- },
416
- end: {
417
- line: 54,
418
- column: 19
419
- }
420
- },
421
- type: "default-arg",
422
- locations: [{
423
- start: {
424
- line: 54,
425
- column: 14
426
- },
427
- end: {
428
- line: 54,
429
- column: 19
430
- }
431
- }],
432
- line: 54
433
- },
434
- "4": {
435
- loc: {
436
- start: {
437
- line: 55,
438
- column: 2
439
- },
440
- end: {
441
- line: 55,
442
- column: 15
443
- }
444
- },
445
- type: "default-arg",
446
- locations: [{
447
- start: {
448
- line: 55,
449
- column: 10
450
- },
451
- end: {
452
- line: 55,
453
- column: 15
454
- }
455
- }],
456
- line: 55
457
- },
458
- "5": {
459
- loc: {
460
- start: {
461
- line: 56,
462
- column: 2
463
- },
464
- end: {
465
- line: 56,
466
- column: 14
467
- }
468
- },
469
- type: "default-arg",
470
- locations: [{
471
- start: {
472
- line: 56,
473
- column: 9
474
- },
475
- end: {
476
- line: 56,
477
- column: 14
478
- }
479
- }],
480
- line: 56
481
- },
482
- "6": {
483
- loc: {
484
- start: {
485
- line: 57,
486
- column: 2
487
- },
488
- end: {
489
- line: 57,
490
- column: 13
491
- }
492
- },
493
- type: "default-arg",
494
- locations: [{
495
- start: {
496
- line: 57,
497
- column: 8
498
- },
499
- end: {
500
- line: 57,
501
- column: 13
502
- }
503
- }],
504
- line: 57
505
- },
506
- "7": {
507
- loc: {
508
- start: {
509
- line: 58,
510
- column: 2
511
- },
512
- end: {
513
- line: 58,
514
- column: 15
515
- }
516
- },
517
- type: "default-arg",
518
- locations: [{
519
- start: {
520
- line: 58,
521
- column: 10
522
- },
523
- end: {
524
- line: 58,
525
- column: 15
526
- }
527
- }],
528
- line: 58
529
- },
530
- "8": {
531
- loc: {
532
- start: {
533
- line: 59,
534
- column: 2
535
- },
536
- end: {
537
- line: 59,
538
- column: 14
539
- }
540
- },
541
- type: "default-arg",
542
- locations: [{
543
- start: {
544
- line: 59,
545
- column: 9
546
- },
547
- end: {
548
- line: 59,
549
- column: 14
550
- }
551
- }],
552
- line: 59
553
- },
554
- "9": {
555
- loc: {
556
- start: {
557
- line: 60,
558
- column: 2
559
- },
560
- end: {
561
- line: 60,
562
- column: 27
563
- }
564
- },
565
- type: "default-arg",
566
- locations: [{
567
- start: {
568
- line: 60,
569
- column: 22
570
- },
571
- end: {
572
- line: 60,
573
- column: 27
574
- }
575
- }],
576
- line: 60
577
- },
578
- "10": {
579
- loc: {
580
- start: {
581
- line: 69,
582
- column: 25
583
- },
584
- end: {
585
- line: 69,
586
- column: 62
587
- }
588
- },
589
- type: "cond-expr",
590
- locations: [{
591
- start: {
592
- line: 69,
593
- column: 32
594
- },
595
- end: {
596
- line: 69,
597
- column: 38
598
- }
599
- }, {
600
- start: {
601
- line: 69,
602
- column: 41
603
- },
604
- end: {
605
- line: 69,
606
- column: 62
607
- }
608
- }],
609
- line: 69
610
- },
611
- "11": {
612
- loc: {
613
- start: {
614
- line: 69,
615
- column: 41
616
- },
617
- end: {
618
- line: 69,
619
- column: 62
620
- }
621
- },
622
- type: "cond-expr",
623
- locations: [{
624
- start: {
625
- line: 69,
626
- column: 48
627
- },
628
- end: {
629
- line: 69,
630
- column: 54
631
- }
632
- }, {
633
- start: {
634
- line: 69,
635
- column: 57
636
- },
637
- end: {
638
- line: 69,
639
- column: 62
640
- }
641
- }],
642
- line: 69
643
- },
644
- "12": {
645
- loc: {
646
- start: {
647
- line: 80,
648
- column: 2
649
- },
650
- end: {
651
- line: 88,
652
- column: 3
653
- }
654
- },
655
- type: "if",
656
- locations: [{
657
- start: {
658
- line: 80,
659
- column: 2
660
- },
661
- end: {
662
- line: 88,
663
- column: 3
664
- }
665
- }, {
666
- start: {
667
- line: undefined,
668
- column: undefined
669
- },
670
- end: {
671
- line: undefined,
672
- column: undefined
673
- }
674
- }],
675
- line: 80
676
- },
677
- "13": {
678
- loc: {
679
- start: {
680
- line: 80,
681
- column: 6
682
- },
683
- end: {
684
- line: 80,
685
- column: 84
686
- }
687
- },
688
- type: "binary-expr",
689
- locations: [{
690
- start: {
691
- line: 80,
692
- column: 6
693
- },
694
- end: {
695
- line: 80,
696
- column: 19
697
- }
698
- }, {
699
- start: {
700
- line: 80,
701
- column: 23
702
- },
703
- end: {
704
- line: 80,
705
- column: 41
706
- }
707
- }, {
708
- start: {
709
- line: 80,
710
- column: 45
711
- },
712
- end: {
713
- line: 80,
714
- column: 74
715
- }
716
- }, {
717
- start: {
718
- line: 80,
719
- column: 78
720
- },
721
- end: {
722
- line: 80,
723
- column: 84
724
- }
725
- }],
726
- line: 80
727
- },
728
- "14": {
729
- loc: {
730
- start: {
731
- line: 92,
732
- column: 4
733
- },
734
- end: {
735
- line: 94,
736
- column: 5
737
- }
738
- },
739
- type: "if",
740
- locations: [{
741
- start: {
742
- line: 92,
743
- column: 4
744
- },
745
- end: {
746
- line: 94,
747
- column: 5
748
- }
749
- }, {
750
- start: {
751
- line: undefined,
752
- column: undefined
753
- },
754
- end: {
755
- line: undefined,
756
- column: undefined
757
- }
758
- }],
759
- line: 92
760
- },
761
- "15": {
762
- loc: {
763
- start: {
764
- line: 106,
765
- column: 2
766
- },
767
- end: {
768
- line: 108,
769
- column: 3
770
- }
771
- },
772
- type: "if",
773
- locations: [{
774
- start: {
775
- line: 106,
776
- column: 2
777
- },
778
- end: {
779
- line: 108,
780
- column: 3
781
- }
782
- }, {
783
- start: {
784
- line: undefined,
785
- column: undefined
786
- },
787
- end: {
788
- line: undefined,
789
- column: undefined
790
- }
791
- }],
792
- line: 106
793
- },
794
- "16": {
795
- loc: {
796
- start: {
797
- line: 109,
798
- column: 2
799
- },
800
- end: {
801
- line: 111,
802
- column: 3
803
- }
804
- },
805
- type: "if",
806
- locations: [{
807
- start: {
808
- line: 109,
809
- column: 2
810
- },
811
- end: {
812
- line: 111,
813
- column: 3
814
- }
815
- }, {
816
- start: {
817
- line: undefined,
818
- column: undefined
819
- },
820
- end: {
821
- line: undefined,
822
- column: undefined
823
- }
824
- }],
825
- line: 109
826
- },
827
- "17": {
828
- loc: {
829
- start: {
830
- line: 120,
831
- column: 2
832
- },
833
- end: {
834
- line: 124,
835
- column: 3
836
- }
837
- },
838
- type: "if",
839
- locations: [{
840
- start: {
841
- line: 120,
842
- column: 2
843
- },
844
- end: {
845
- line: 124,
846
- column: 3
847
- }
848
- }, {
849
- start: {
850
- line: 122,
851
- column: 9
852
- },
853
- end: {
854
- line: 124,
855
- column: 3
856
- }
857
- }],
858
- line: 120
859
- }
860
- },
861
- s: {
862
- "0": 0,
863
- "1": 0,
864
- "2": 0,
865
- "3": 0,
866
- "4": 0,
867
- "5": 0,
868
- "6": 0,
869
- "7": 0,
870
- "8": 0,
871
- "9": 0,
872
- "10": 0,
873
- "11": 0,
874
- "12": 0,
875
- "13": 0,
876
- "14": 0,
877
- "15": 0,
878
- "16": 0,
879
- "17": 0,
880
- "18": 0,
881
- "19": 0,
882
- "20": 0,
883
- "21": 0,
884
- "22": 0,
885
- "23": 0
886
- },
887
- f: {
888
- "0": 0,
889
- "1": 0,
890
- "2": 0
891
- },
892
- b: {
893
- "0": [0],
894
- "1": [0],
895
- "2": [0],
896
- "3": [0],
897
- "4": [0],
898
- "5": [0],
899
- "6": [0],
900
- "7": [0],
901
- "8": [0],
902
- "9": [0],
903
- "10": [0, 0],
904
- "11": [0, 0],
905
- "12": [0, 0],
906
- "13": [0, 0, 0, 0],
907
- "14": [0, 0],
908
- "15": [0, 0],
909
- "16": [0, 0],
910
- "17": [0, 0]
911
- },
912
- _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
913
- hash: "efe77f0db628ee432080465bad4470b265b5f217"
914
- };
915
- var coverage = global[gcv] || (global[gcv] = {});
916
- if (!coverage[path] || coverage[path].hash !== hash) {
917
- coverage[path] = coverageData;
918
- }
919
- var actualCoverage = coverage[path];
920
- {
921
- // @ts-ignore
922
- cov_1ss29zpusr = function () {
923
- return actualCoverage;
924
- };
925
- }
926
- return actualCoverage;
927
- }
928
- cov_1ss29zpusr();
11
+ var e;
12
+ function _interopRequireWildcard(t, r) { if (!r && t && t.__esModule) return t; var n, a, o = Object.defineProperty, f = { __proto__: null, default: t }; if (Object(t) !== t) return f; if (e || "function" != typeof WeakMap || (e = new WeakMap()), e) { if (e.has(t)) return e.get(t); e.set(t, f); } for (a in t) "default" !== a && {}.hasOwnProperty.call(t, a) && ((n = o && Object.getOwnPropertyDescriptor(t, a)) && (n.get || n.set) ? o(f, a, n) : f[a] = t[a]); return f; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
929
14
  let {
930
15
  addPathToAdapterConfig,
931
16
  generateInstallAdapterCommand,
932
17
  getInstallStringMappings
933
- } = (cov_1ss29zpusr().s[0]++, adapter);
934
- var _default = init;
935
- exports.default = _default;
936
- const CLI_PATH = (cov_1ss29zpusr().s[1]++, _path.default.normalize(_path.default.join(__dirname, '../../')));
18
+ } = adapter;
19
+ var _default = exports.default = init;
20
+ const CLI_PATH = _nodePath.default.normalize(_nodePath.default.join(__dirname, '../../'));
937
21
 
938
22
  /**
939
23
  * CZ INIT
@@ -952,7 +36,7 @@ const CLI_PATH = (cov_1ss29zpusr().s[1]++, _path.default.normalize(_path.default
952
36
  /**
953
37
  * The defaults for init
954
38
  */
955
- const defaultInitOptions = (cov_1ss29zpusr().s[2]++, {
39
+ const defaultInitOptions = {
956
40
  save: false,
957
41
  saveDev: true,
958
42
  saveExact: false,
@@ -965,49 +49,45 @@ const defaultInitOptions = (cov_1ss29zpusr().s[2]++, {
965
49
  // should add trailing comma, thus next developer doesn't got blamed for this line
966
50
 
967
51
  pnpm: false // reuses `save`, `saveDev`, `saveExact`
968
- });
52
+ };
969
53
 
970
54
  /**
971
55
  * Runs npm install for the adapter then modifies the config.commitizen as needed
972
56
  */
973
57
  function init(repoPath, adapterNpmName, {
974
- save = (cov_1ss29zpusr().b[1][0]++, false),
975
- saveDev = (cov_1ss29zpusr().b[2][0]++, true),
976
- saveExact = (cov_1ss29zpusr().b[3][0]++, false),
977
- force = (cov_1ss29zpusr().b[4][0]++, false),
978
- yarn = (cov_1ss29zpusr().b[5][0]++, false),
979
- dev = (cov_1ss29zpusr().b[6][0]++, false),
980
- exact = (cov_1ss29zpusr().b[7][0]++, false),
981
- pnpm = (cov_1ss29zpusr().b[8][0]++, false),
982
- includeCommitizen = (cov_1ss29zpusr().b[9][0]++, false)
983
- } = (cov_1ss29zpusr().b[0][0]++, defaultInitOptions)) {
984
- cov_1ss29zpusr().f[0]++;
985
- cov_1ss29zpusr().s[3]++;
58
+ save = false,
59
+ saveDev = !save,
60
+ saveExact = false,
61
+ force = false,
62
+ yarn = false,
63
+ dev = false,
64
+ exact = false,
65
+ pnpm = false,
66
+ includeCommitizen = false
67
+ } = defaultInitOptions) {
986
68
  // Don't let things move forward if required args are missing
987
69
  checkRequiredArguments(repoPath, adapterNpmName);
988
70
 
989
71
  // Load the current adapter config
990
- let adapterConfig = (cov_1ss29zpusr().s[4]++, loadAdapterConfig(repoPath));
991
- const packageManager = (cov_1ss29zpusr().s[5]++, yarn ? (cov_1ss29zpusr().b[10][0]++, 'yarn') : (cov_1ss29zpusr().b[10][1]++, pnpm ? (cov_1ss29zpusr().b[11][0]++, 'pnpm') : (cov_1ss29zpusr().b[11][1]++, 'npm')));
72
+ let adapterConfig = loadAdapterConfig(repoPath);
73
+ const packageManager = yarn ? 'yarn' : pnpm ? 'pnpm' : 'npm';
992
74
 
993
75
  // Get the npm string mappings based on the arguments provided
994
- const stringMappings = (cov_1ss29zpusr().s[6]++, getInstallStringMappings({
76
+ const stringMappings = getInstallStringMappings({
995
77
  save,
996
78
  dev,
997
79
  saveDev,
80
+ exact,
998
81
  saveExact,
999
82
  force
1000
- }, packageManager));
83
+ }, packageManager);
1001
84
 
1002
85
  // Generate a string that represents the npm install command
1003
- const installAdapterCommand = (cov_1ss29zpusr().s[7]++, generateInstallAdapterCommand(stringMappings, adapterNpmName, packageManager));
1004
- const installCommitizenCommand = (cov_1ss29zpusr().s[8]++, generateInstallAdapterCommand(stringMappings, 'commitizen', packageManager));
86
+ const installAdapterCommand = generateInstallAdapterCommand(stringMappings, adapterNpmName, packageManager);
87
+ const installCommitizenCommand = generateInstallAdapterCommand(stringMappings, 'commitizen', packageManager);
1005
88
 
1006
89
  // Check for previously installed adapters
1007
- cov_1ss29zpusr().s[9]++;
1008
- if ((cov_1ss29zpusr().b[13][0]++, adapterConfig) && (cov_1ss29zpusr().b[13][1]++, adapterConfig.path) && (cov_1ss29zpusr().b[13][2]++, adapterConfig.path.length > 0) && (cov_1ss29zpusr().b[13][3]++, !force)) {
1009
- cov_1ss29zpusr().b[12][0]++;
1010
- cov_1ss29zpusr().s[10]++;
90
+ if (adapterConfig && adapterConfig.path && adapterConfig.path.length > 0 && !force) {
1011
91
  throw new Error(`A previous adapter is already configured. Use --force to override
1012
92
  adapterConfig.path: ${adapterConfig.path}
1013
93
  repoPath: ${repoPath}
@@ -1015,29 +95,18 @@ function init(repoPath, adapterNpmName, {
1015
95
  installAdapterCommand: ${installAdapterCommand}
1016
96
  adapterNpmName: ${adapterNpmName}
1017
97
  `);
1018
- } else {
1019
- cov_1ss29zpusr().b[12][1]++;
1020
98
  }
1021
- cov_1ss29zpusr().s[11]++;
1022
99
  try {
1023
- cov_1ss29zpusr().s[12]++;
1024
- _child_process.default.execSync(installAdapterCommand, {
100
+ _nodeChild_process.default.execSync(installAdapterCommand, {
1025
101
  cwd: repoPath
1026
102
  });
1027
- cov_1ss29zpusr().s[13]++;
1028
103
  if (includeCommitizen) {
1029
- cov_1ss29zpusr().b[14][0]++;
1030
- cov_1ss29zpusr().s[14]++;
1031
- _child_process.default.execSync(installCommitizenCommand, {
104
+ _nodeChild_process.default.execSync(installCommitizenCommand, {
1032
105
  cwd: repoPath
1033
106
  });
1034
- } else {
1035
- cov_1ss29zpusr().b[14][1]++;
1036
107
  }
1037
- cov_1ss29zpusr().s[15]++;
1038
108
  addPathToAdapterConfig(CLI_PATH, repoPath, adapterNpmName);
1039
109
  } catch (e) {
1040
- cov_1ss29zpusr().s[16]++;
1041
110
  console.error(e);
1042
111
  }
1043
112
  }
@@ -1047,22 +116,11 @@ function init(repoPath, adapterNpmName, {
1047
116
  * Throws an exception if any are not.
1048
117
  */
1049
118
  function checkRequiredArguments(path, adapterNpmName) {
1050
- cov_1ss29zpusr().f[1]++;
1051
- cov_1ss29zpusr().s[17]++;
1052
119
  if (!path) {
1053
- cov_1ss29zpusr().b[15][0]++;
1054
- cov_1ss29zpusr().s[18]++;
1055
120
  throw new Error("Path is required when running init.");
1056
- } else {
1057
- cov_1ss29zpusr().b[15][1]++;
1058
121
  }
1059
- cov_1ss29zpusr().s[19]++;
1060
122
  if (!adapterNpmName) {
1061
- cov_1ss29zpusr().b[16][0]++;
1062
- cov_1ss29zpusr().s[20]++;
1063
123
  throw new Error("The adapter's npm name is required when running init.");
1064
- } else {
1065
- cov_1ss29zpusr().b[16][1]++;
1066
124
  }
1067
125
  }
1068
126
 
@@ -1071,14 +129,8 @@ function checkRequiredArguments(path, adapterNpmName) {
1071
129
  * Loads and returns the adapter config at key config.commitizen, if it exists
1072
130
  */
1073
131
  function loadAdapterConfig(cwd) {
1074
- cov_1ss29zpusr().f[2]++;
1075
- let config = (cov_1ss29zpusr().s[21]++, configLoader.load(null, cwd));
1076
- cov_1ss29zpusr().s[22]++;
132
+ let config = configLoader.load(null, cwd);
1077
133
  if (config) {
1078
- cov_1ss29zpusr().b[17][0]++;
1079
- cov_1ss29zpusr().s[23]++;
1080
134
  return config;
1081
- } else {
1082
- cov_1ss29zpusr().b[17][1]++;
1083
- }
135
+ } else {}
1084
136
  }