commitizen 4.2.6 → 4.3.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.
@@ -4,24 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _child_process = _interopRequireDefault(require("child_process"));
9
-
10
8
  var _path = _interopRequireDefault(require("path"));
11
-
12
9
  var configLoader = _interopRequireWildcard(require("./configLoader"));
13
-
14
10
  var adapter = _interopRequireWildcard(require("./adapter"));
15
-
16
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); }
17
-
18
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; }
19
-
20
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
14
  function cov_1ss29zpusr() {
23
15
  var path = "/home/runner/work/cz-cli/cz-cli/src/commitizen/init.js";
24
- var hash = "e4f46936046367f86f542d40fc45a41f7f10a7af";
16
+ var hash = "efe77f0db628ee432080465bad4470b265b5f217";
25
17
  var global = new Function("return this")();
26
18
  var gcv = "__coverage__";
27
19
  var coverageData = {
@@ -29,27 +21,27 @@ function cov_1ss29zpusr() {
29
21
  statementMap: {
30
22
  "0": {
31
23
  start: {
32
- line: 12,
24
+ line: 10,
33
25
  column: 4
34
26
  },
35
27
  end: {
36
- line: 12,
28
+ line: 10,
37
29
  column: 11
38
30
  }
39
31
  },
40
32
  "1": {
41
33
  start: {
42
- line: 16,
34
+ line: 14,
43
35
  column: 17
44
36
  },
45
37
  end: {
46
- line: 16,
38
+ line: 14,
47
39
  column: 63
48
40
  }
49
41
  },
50
42
  "2": {
51
43
  start: {
52
- line: 35,
44
+ line: 33,
53
45
  column: 27
54
46
  },
55
47
  end: {
@@ -59,201 +51,211 @@ function cov_1ss29zpusr() {
59
51
  },
60
52
  "3": {
61
53
  start: {
62
- line: 63,
54
+ line: 64,
63
55
  column: 2
64
56
  },
65
57
  end: {
66
- line: 63,
58
+ line: 64,
67
59
  column: 51
68
60
  }
69
61
  },
70
62
  "4": {
71
63
  start: {
72
- line: 66,
64
+ line: 67,
73
65
  column: 22
74
66
  },
75
67
  end: {
76
- line: 66,
68
+ line: 67,
77
69
  column: 49
78
70
  }
79
71
  },
80
72
  "5": {
81
73
  start: {
82
74
  line: 69,
83
- column: 23
75
+ column: 25
84
76
  },
85
77
  end: {
86
78
  line: 69,
87
- column: 136
79
+ column: 62
88
80
  }
89
81
  },
90
82
  "6": {
91
83
  start: {
92
84
  line: 72,
93
- column: 30
85
+ column: 25
94
86
  },
95
87
  end: {
96
88
  line: 72,
97
- column: 165
89
+ column: 107
98
90
  }
99
91
  },
100
92
  "7": {
101
93
  start: {
102
- line: 74,
103
- column: 33
94
+ line: 75,
95
+ column: 32
104
96
  },
105
97
  end: {
106
- line: 74,
107
- column: 164
98
+ line: 75,
99
+ column: 109
108
100
  }
109
101
  },
110
102
  "8": {
111
103
  start: {
112
104
  line: 77,
105
+ column: 35
106
+ },
107
+ end: {
108
+ line: 77,
109
+ column: 110
110
+ }
111
+ },
112
+ "9": {
113
+ start: {
114
+ line: 80,
113
115
  column: 2
114
116
  },
115
117
  end: {
116
- line: 85,
118
+ line: 88,
117
119
  column: 3
118
120
  }
119
121
  },
120
- "9": {
122
+ "10": {
121
123
  start: {
122
- line: 78,
124
+ line: 81,
123
125
  column: 4
124
126
  },
125
127
  end: {
126
- line: 84,
128
+ line: 87,
127
129
  column: 7
128
130
  }
129
131
  },
130
- "10": {
132
+ "11": {
131
133
  start: {
132
- line: 87,
134
+ line: 90,
133
135
  column: 2
134
136
  },
135
137
  end: {
136
- line: 95,
138
+ line: 98,
137
139
  column: 3
138
140
  }
139
141
  },
140
- "11": {
142
+ "12": {
141
143
  start: {
142
- line: 88,
144
+ line: 91,
143
145
  column: 4
144
146
  },
145
147
  end: {
146
- line: 88,
148
+ line: 91,
147
149
  column: 68
148
150
  }
149
151
  },
150
- "12": {
152
+ "13": {
151
153
  start: {
152
- line: 89,
154
+ line: 92,
153
155
  column: 4
154
156
  },
155
157
  end: {
156
- line: 91,
158
+ line: 94,
157
159
  column: 5
158
160
  }
159
161
  },
160
- "13": {
162
+ "14": {
161
163
  start: {
162
- line: 90,
164
+ line: 93,
163
165
  column: 6
164
166
  },
165
167
  end: {
166
- line: 90,
168
+ line: 93,
167
169
  column: 73
168
170
  }
169
171
  },
170
- "14": {
172
+ "15": {
171
173
  start: {
172
- line: 92,
174
+ line: 95,
173
175
  column: 4
174
176
  },
175
177
  end: {
176
- line: 92,
178
+ line: 95,
177
179
  column: 63
178
180
  }
179
181
  },
180
- "15": {
182
+ "16": {
181
183
  start: {
182
- line: 94,
184
+ line: 97,
183
185
  column: 4
184
186
  },
185
187
  end: {
186
- line: 94,
188
+ line: 97,
187
189
  column: 21
188
190
  }
189
191
  },
190
- "16": {
192
+ "17": {
191
193
  start: {
192
- line: 103,
194
+ line: 106,
193
195
  column: 2
194
196
  },
195
197
  end: {
196
- line: 105,
198
+ line: 108,
197
199
  column: 3
198
200
  }
199
201
  },
200
- "17": {
202
+ "18": {
201
203
  start: {
202
- line: 104,
204
+ line: 107,
203
205
  column: 4
204
206
  },
205
207
  end: {
206
- line: 104,
208
+ line: 107,
207
209
  column: 59
208
210
  }
209
211
  },
210
- "18": {
212
+ "19": {
211
213
  start: {
212
- line: 106,
214
+ line: 109,
213
215
  column: 2
214
216
  },
215
217
  end: {
216
- line: 108,
218
+ line: 111,
217
219
  column: 3
218
220
  }
219
221
  },
220
- "19": {
222
+ "20": {
221
223
  start: {
222
- line: 107,
224
+ line: 110,
223
225
  column: 4
224
226
  },
225
227
  end: {
226
- line: 107,
228
+ line: 110,
227
229
  column: 77
228
230
  }
229
231
  },
230
- "20": {
232
+ "21": {
231
233
  start: {
232
- line: 116,
234
+ line: 119,
233
235
  column: 15
234
236
  },
235
237
  end: {
236
- line: 116,
238
+ line: 119,
237
239
  column: 43
238
240
  }
239
241
  },
240
- "21": {
242
+ "22": {
241
243
  start: {
242
- line: 117,
244
+ line: 120,
243
245
  column: 2
244
246
  },
245
247
  end: {
246
- line: 121,
248
+ line: 124,
247
249
  column: 3
248
250
  }
249
251
  },
250
- "22": {
252
+ "23": {
251
253
  start: {
252
- line: 118,
254
+ line: 121,
253
255
  column: 4
254
256
  },
255
257
  end: {
256
- line: 118,
258
+ line: 121,
257
259
  column: 18
258
260
  }
259
261
  }
@@ -273,63 +275,63 @@ function cov_1ss29zpusr() {
273
275
  },
274
276
  loc: {
275
277
  start: {
276
- line: 60,
278
+ line: 61,
277
279
  column: 24
278
280
  },
279
281
  end: {
280
- line: 96,
282
+ line: 99,
281
283
  column: 1
282
284
  }
283
285
  },
284
- line: 60
286
+ line: 61
285
287
  },
286
288
  "1": {
287
289
  name: "checkRequiredArguments",
288
290
  decl: {
289
291
  start: {
290
- line: 102,
292
+ line: 105,
291
293
  column: 9
292
294
  },
293
295
  end: {
294
- line: 102,
296
+ line: 105,
295
297
  column: 31
296
298
  }
297
299
  },
298
300
  loc: {
299
301
  start: {
300
- line: 102,
302
+ line: 105,
301
303
  column: 55
302
304
  },
303
305
  end: {
304
- line: 109,
306
+ line: 112,
305
307
  column: 1
306
308
  }
307
309
  },
308
- line: 102
310
+ line: 105
309
311
  },
310
312
  "2": {
311
313
  name: "loadAdapterConfig",
312
314
  decl: {
313
315
  start: {
314
- line: 115,
316
+ line: 118,
315
317
  column: 9
316
318
  },
317
319
  end: {
318
- line: 115,
320
+ line: 118,
319
321
  column: 26
320
322
  }
321
323
  },
322
324
  loc: {
323
325
  start: {
324
- line: 115,
326
+ line: 118,
325
327
  column: 33
326
328
  },
327
329
  end: {
328
- line: 122,
330
+ line: 125,
329
331
  column: 1
330
332
  }
331
333
  },
332
- line: 115
334
+ line: 118
333
335
  }
334
336
  },
335
337
  branchMap: {
@@ -340,18 +342,18 @@ function cov_1ss29zpusr() {
340
342
  column: 41
341
343
  },
342
344
  end: {
343
- line: 60,
345
+ line: 61,
344
346
  column: 22
345
347
  }
346
348
  },
347
349
  type: "default-arg",
348
350
  locations: [{
349
351
  start: {
350
- line: 60,
352
+ line: 61,
351
353
  column: 4
352
354
  },
353
355
  end: {
354
- line: 60,
356
+ line: 61,
355
357
  column: 22
356
358
  }
357
359
  }],
@@ -533,18 +535,18 @@ function cov_1ss29zpusr() {
533
535
  },
534
536
  end: {
535
537
  line: 59,
536
- column: 27
538
+ column: 14
537
539
  }
538
540
  },
539
541
  type: "default-arg",
540
542
  locations: [{
541
543
  start: {
542
544
  line: 59,
543
- column: 22
545
+ column: 9
544
546
  },
545
547
  end: {
546
548
  line: 59,
547
- column: 27
549
+ column: 14
548
550
  }
549
551
  }],
550
552
  line: 59
@@ -552,121 +554,112 @@ function cov_1ss29zpusr() {
552
554
  "9": {
553
555
  loc: {
554
556
  start: {
555
- line: 69,
556
- column: 23
557
+ line: 60,
558
+ column: 2
557
559
  },
558
560
  end: {
559
- line: 69,
560
- column: 136
561
+ line: 60,
562
+ column: 27
561
563
  }
562
564
  },
563
- type: "cond-expr",
565
+ type: "default-arg",
564
566
  locations: [{
565
567
  start: {
566
- line: 69,
567
- column: 30
568
- },
569
- end: {
570
- line: 69,
571
- column: 73
572
- }
573
- }, {
574
- start: {
575
- line: 69,
576
- column: 76
568
+ line: 60,
569
+ column: 22
577
570
  },
578
571
  end: {
579
- line: 69,
580
- column: 136
572
+ line: 60,
573
+ column: 27
581
574
  }
582
575
  }],
583
- line: 69
576
+ line: 60
584
577
  },
585
578
  "10": {
586
579
  loc: {
587
580
  start: {
588
- line: 72,
589
- column: 30
581
+ line: 69,
582
+ column: 25
590
583
  },
591
584
  end: {
592
- line: 72,
593
- column: 165
585
+ line: 69,
586
+ column: 62
594
587
  }
595
588
  },
596
589
  type: "cond-expr",
597
590
  locations: [{
598
591
  start: {
599
- line: 72,
600
- column: 37
592
+ line: 69,
593
+ column: 32
601
594
  },
602
595
  end: {
603
- line: 72,
604
- column: 98
596
+ line: 69,
597
+ column: 38
605
598
  }
606
599
  }, {
607
600
  start: {
608
- line: 72,
609
- column: 101
601
+ line: 69,
602
+ column: 41
610
603
  },
611
604
  end: {
612
- line: 72,
613
- column: 165
605
+ line: 69,
606
+ column: 62
614
607
  }
615
608
  }],
616
- line: 72
609
+ line: 69
617
610
  },
618
611
  "11": {
619
612
  loc: {
620
613
  start: {
621
- line: 74,
622
- column: 33
614
+ line: 69,
615
+ column: 41
623
616
  },
624
617
  end: {
625
- line: 74,
626
- column: 164
618
+ line: 69,
619
+ column: 62
627
620
  }
628
621
  },
629
622
  type: "cond-expr",
630
623
  locations: [{
631
624
  start: {
632
- line: 74,
633
- column: 40
625
+ line: 69,
626
+ column: 48
634
627
  },
635
628
  end: {
636
- line: 74,
637
- column: 99
629
+ line: 69,
630
+ column: 54
638
631
  }
639
632
  }, {
640
633
  start: {
641
- line: 74,
642
- column: 102
634
+ line: 69,
635
+ column: 57
643
636
  },
644
637
  end: {
645
- line: 74,
646
- column: 164
638
+ line: 69,
639
+ column: 62
647
640
  }
648
641
  }],
649
- line: 74
642
+ line: 69
650
643
  },
651
644
  "12": {
652
645
  loc: {
653
646
  start: {
654
- line: 77,
647
+ line: 80,
655
648
  column: 2
656
649
  },
657
650
  end: {
658
- line: 85,
651
+ line: 88,
659
652
  column: 3
660
653
  }
661
654
  },
662
655
  type: "if",
663
656
  locations: [{
664
657
  start: {
665
- line: 77,
658
+ line: 80,
666
659
  column: 2
667
660
  },
668
661
  end: {
669
- line: 85,
662
+ line: 88,
670
663
  column: 3
671
664
  }
672
665
  }, {
@@ -679,78 +672,78 @@ function cov_1ss29zpusr() {
679
672
  column: undefined
680
673
  }
681
674
  }],
682
- line: 77
675
+ line: 80
683
676
  },
684
677
  "13": {
685
678
  loc: {
686
679
  start: {
687
- line: 77,
680
+ line: 80,
688
681
  column: 6
689
682
  },
690
683
  end: {
691
- line: 77,
684
+ line: 80,
692
685
  column: 84
693
686
  }
694
687
  },
695
688
  type: "binary-expr",
696
689
  locations: [{
697
690
  start: {
698
- line: 77,
691
+ line: 80,
699
692
  column: 6
700
693
  },
701
694
  end: {
702
- line: 77,
695
+ line: 80,
703
696
  column: 19
704
697
  }
705
698
  }, {
706
699
  start: {
707
- line: 77,
700
+ line: 80,
708
701
  column: 23
709
702
  },
710
703
  end: {
711
- line: 77,
704
+ line: 80,
712
705
  column: 41
713
706
  }
714
707
  }, {
715
708
  start: {
716
- line: 77,
709
+ line: 80,
717
710
  column: 45
718
711
  },
719
712
  end: {
720
- line: 77,
713
+ line: 80,
721
714
  column: 74
722
715
  }
723
716
  }, {
724
717
  start: {
725
- line: 77,
718
+ line: 80,
726
719
  column: 78
727
720
  },
728
721
  end: {
729
- line: 77,
722
+ line: 80,
730
723
  column: 84
731
724
  }
732
725
  }],
733
- line: 77
726
+ line: 80
734
727
  },
735
728
  "14": {
736
729
  loc: {
737
730
  start: {
738
- line: 89,
731
+ line: 92,
739
732
  column: 4
740
733
  },
741
734
  end: {
742
- line: 91,
735
+ line: 94,
743
736
  column: 5
744
737
  }
745
738
  },
746
739
  type: "if",
747
740
  locations: [{
748
741
  start: {
749
- line: 89,
742
+ line: 92,
750
743
  column: 4
751
744
  },
752
745
  end: {
753
- line: 91,
746
+ line: 94,
754
747
  column: 5
755
748
  }
756
749
  }, {
@@ -763,27 +756,27 @@ function cov_1ss29zpusr() {
763
756
  column: undefined
764
757
  }
765
758
  }],
766
- line: 89
759
+ line: 92
767
760
  },
768
761
  "15": {
769
762
  loc: {
770
763
  start: {
771
- line: 103,
764
+ line: 106,
772
765
  column: 2
773
766
  },
774
767
  end: {
775
- line: 105,
768
+ line: 108,
776
769
  column: 3
777
770
  }
778
771
  },
779
772
  type: "if",
780
773
  locations: [{
781
774
  start: {
782
- line: 103,
775
+ line: 106,
783
776
  column: 2
784
777
  },
785
778
  end: {
786
- line: 105,
779
+ line: 108,
787
780
  column: 3
788
781
  }
789
782
  }, {
@@ -796,27 +789,27 @@ function cov_1ss29zpusr() {
796
789
  column: undefined
797
790
  }
798
791
  }],
799
- line: 103
792
+ line: 106
800
793
  },
801
794
  "16": {
802
795
  loc: {
803
796
  start: {
804
- line: 106,
797
+ line: 109,
805
798
  column: 2
806
799
  },
807
800
  end: {
808
- line: 108,
801
+ line: 111,
809
802
  column: 3
810
803
  }
811
804
  },
812
805
  type: "if",
813
806
  locations: [{
814
807
  start: {
815
- line: 106,
808
+ line: 109,
816
809
  column: 2
817
810
  },
818
811
  end: {
819
- line: 108,
812
+ line: 111,
820
813
  column: 3
821
814
  }
822
815
  }, {
@@ -829,40 +822,40 @@ function cov_1ss29zpusr() {
829
822
  column: undefined
830
823
  }
831
824
  }],
832
- line: 106
825
+ line: 109
833
826
  },
834
827
  "17": {
835
828
  loc: {
836
829
  start: {
837
- line: 117,
830
+ line: 120,
838
831
  column: 2
839
832
  },
840
833
  end: {
841
- line: 121,
834
+ line: 124,
842
835
  column: 3
843
836
  }
844
837
  },
845
838
  type: "if",
846
839
  locations: [{
847
840
  start: {
848
- line: 117,
841
+ line: 120,
849
842
  column: 2
850
843
  },
851
844
  end: {
852
- line: 121,
845
+ line: 124,
853
846
  column: 3
854
847
  }
855
848
  }, {
856
849
  start: {
857
- line: 119,
850
+ line: 122,
858
851
  column: 9
859
852
  },
860
853
  end: {
861
- line: 121,
854
+ line: 124,
862
855
  column: 3
863
856
  }
864
857
  }],
865
- line: 117
858
+ line: 120
866
859
  }
867
860
  },
868
861
  s: {
@@ -888,7 +881,8 @@ function cov_1ss29zpusr() {
888
881
  "19": 0,
889
882
  "20": 0,
890
883
  "21": 0,
891
- "22": 0
884
+ "22": 0,
885
+ "23": 0
892
886
  },
893
887
  f: {
894
888
  "0": 0,
@@ -905,7 +899,7 @@ function cov_1ss29zpusr() {
905
899
  "6": [0],
906
900
  "7": [0],
907
901
  "8": [0],
908
- "9": [0, 0],
902
+ "9": [0],
909
903
  "10": [0, 0],
910
904
  "11": [0, 0],
911
905
  "12": [0, 0],
@@ -916,14 +910,12 @@ function cov_1ss29zpusr() {
916
910
  "17": [0, 0]
917
911
  },
918
912
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
919
- hash: "e4f46936046367f86f542d40fc45a41f7f10a7af"
913
+ hash: "efe77f0db628ee432080465bad4470b265b5f217"
920
914
  };
921
915
  var coverage = global[gcv] || (global[gcv] = {});
922
-
923
916
  if (!coverage[path] || coverage[path].hash !== hash) {
924
917
  coverage[path] = coverageData;
925
918
  }
926
-
927
919
  var actualCoverage = coverage[path];
928
920
  {
929
921
  // @ts-ignore
@@ -933,18 +925,16 @@ function cov_1ss29zpusr() {
933
925
  }
934
926
  return actualCoverage;
935
927
  }
936
-
937
928
  cov_1ss29zpusr();
938
929
  let {
939
930
  addPathToAdapterConfig,
940
- generateNpmInstallAdapterCommand,
941
- getNpmInstallStringMappings,
942
- generateYarnAddAdapterCommand,
943
- getYarnAddStringMappings
931
+ generateInstallAdapterCommand,
932
+ getInstallStringMappings
944
933
  } = (cov_1ss29zpusr().s[0]++, adapter);
945
934
  var _default = init;
946
935
  exports.default = _default;
947
936
  const CLI_PATH = (cov_1ss29zpusr().s[1]++, _path.default.normalize(_path.default.join(__dirname, '../../')));
937
+
948
938
  /**
949
939
  * CZ INIT
950
940
  *
@@ -962,7 +952,6 @@ const CLI_PATH = (cov_1ss29zpusr().s[1]++, _path.default.normalize(_path.default
962
952
  /**
963
953
  * The defaults for init
964
954
  */
965
-
966
955
  const defaultInitOptions = (cov_1ss29zpusr().s[2]++, {
967
956
  save: false,
968
957
  saveDev: true,
@@ -972,13 +961,15 @@ const defaultInitOptions = (cov_1ss29zpusr().s[2]++, {
972
961
  // @see https://github.com/commitizen/cz-cli/issues/527#issuecomment-392653897
973
962
  yarn: false,
974
963
  dev: true,
975
- exact: false // should add trailing comma, thus next developer doesn't got blamed for this line
964
+ exact: false,
965
+ // should add trailing comma, thus next developer doesn't got blamed for this line
976
966
 
967
+ pnpm: false // reuses `save`, `saveDev`, `saveExact`
977
968
  });
969
+
978
970
  /**
979
971
  * Runs npm install for the adapter then modifies the config.commitizen as needed
980
972
  */
981
-
982
973
  function init(repoPath, adapterNpmName, {
983
974
  save = (cov_1ss29zpusr().b[1][0]++, false),
984
975
  saveDev = (cov_1ss29zpusr().b[2][0]++, true),
@@ -987,25 +978,36 @@ function init(repoPath, adapterNpmName, {
987
978
  yarn = (cov_1ss29zpusr().b[5][0]++, false),
988
979
  dev = (cov_1ss29zpusr().b[6][0]++, false),
989
980
  exact = (cov_1ss29zpusr().b[7][0]++, false),
990
- includeCommitizen = (cov_1ss29zpusr().b[8][0]++, false)
981
+ pnpm = (cov_1ss29zpusr().b[8][0]++, false),
982
+ includeCommitizen = (cov_1ss29zpusr().b[9][0]++, false)
991
983
  } = (cov_1ss29zpusr().b[0][0]++, defaultInitOptions)) {
992
984
  cov_1ss29zpusr().f[0]++;
993
985
  cov_1ss29zpusr().s[3]++;
994
986
  // Don't let things move forward if required args are missing
995
- checkRequiredArguments(repoPath, adapterNpmName); // Load the current adapter config
996
-
997
- let adapterConfig = (cov_1ss29zpusr().s[4]++, loadAdapterConfig(repoPath)); // Get the npm string mappings based on the arguments provided
987
+ checkRequiredArguments(repoPath, adapterNpmName);
998
988
 
999
- let stringMappings = (cov_1ss29zpusr().s[5]++, yarn ? (cov_1ss29zpusr().b[9][0]++, getYarnAddStringMappings(dev, exact, force)) : (cov_1ss29zpusr().b[9][1]++, getNpmInstallStringMappings(save, saveDev, saveExact, force))); // Generate a string that represents the npm install command
989
+ // 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')));
1000
992
 
1001
- let installAdapterCommand = (cov_1ss29zpusr().s[6]++, yarn ? (cov_1ss29zpusr().b[10][0]++, generateYarnAddAdapterCommand(stringMappings, adapterNpmName)) : (cov_1ss29zpusr().b[10][1]++, generateNpmInstallAdapterCommand(stringMappings, adapterNpmName)));
1002
- let installCommitizenCommand = (cov_1ss29zpusr().s[7]++, yarn ? (cov_1ss29zpusr().b[11][0]++, generateYarnAddAdapterCommand(stringMappings, "commitizen")) : (cov_1ss29zpusr().b[11][1]++, generateNpmInstallAdapterCommand(stringMappings, "commitizen"))); // Check for previously installed adapters
993
+ // Get the npm string mappings based on the arguments provided
994
+ const stringMappings = (cov_1ss29zpusr().s[6]++, getInstallStringMappings({
995
+ save,
996
+ dev,
997
+ saveDev,
998
+ saveExact,
999
+ force
1000
+ }, packageManager));
1003
1001
 
1004
- cov_1ss29zpusr().s[8]++;
1002
+ // 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));
1005
1005
 
1006
+ // Check for previously installed adapters
1007
+ cov_1ss29zpusr().s[9]++;
1006
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)) {
1007
1009
  cov_1ss29zpusr().b[12][0]++;
1008
- cov_1ss29zpusr().s[9]++;
1010
+ cov_1ss29zpusr().s[10]++;
1009
1011
  throw new Error(`A previous adapter is already configured. Use --force to override
1010
1012
  adapterConfig.path: ${adapterConfig.path}
1011
1013
  repoPath: ${repoPath}
@@ -1016,78 +1018,65 @@ function init(repoPath, adapterNpmName, {
1016
1018
  } else {
1017
1019
  cov_1ss29zpusr().b[12][1]++;
1018
1020
  }
1019
-
1020
- cov_1ss29zpusr().s[10]++;
1021
-
1021
+ cov_1ss29zpusr().s[11]++;
1022
1022
  try {
1023
- cov_1ss29zpusr().s[11]++;
1024
-
1023
+ cov_1ss29zpusr().s[12]++;
1025
1024
  _child_process.default.execSync(installAdapterCommand, {
1026
1025
  cwd: repoPath
1027
1026
  });
1028
-
1029
- cov_1ss29zpusr().s[12]++;
1030
-
1027
+ cov_1ss29zpusr().s[13]++;
1031
1028
  if (includeCommitizen) {
1032
1029
  cov_1ss29zpusr().b[14][0]++;
1033
- cov_1ss29zpusr().s[13]++;
1034
-
1030
+ cov_1ss29zpusr().s[14]++;
1035
1031
  _child_process.default.execSync(installCommitizenCommand, {
1036
1032
  cwd: repoPath
1037
1033
  });
1038
1034
  } else {
1039
1035
  cov_1ss29zpusr().b[14][1]++;
1040
1036
  }
1041
-
1042
- cov_1ss29zpusr().s[14]++;
1037
+ cov_1ss29zpusr().s[15]++;
1043
1038
  addPathToAdapterConfig(CLI_PATH, repoPath, adapterNpmName);
1044
1039
  } catch (e) {
1045
- cov_1ss29zpusr().s[15]++;
1040
+ cov_1ss29zpusr().s[16]++;
1046
1041
  console.error(e);
1047
1042
  }
1048
1043
  }
1044
+
1049
1045
  /**
1050
1046
  * Checks to make sure that the required arguments are passed
1051
1047
  * Throws an exception if any are not.
1052
1048
  */
1053
-
1054
-
1055
1049
  function checkRequiredArguments(path, adapterNpmName) {
1056
1050
  cov_1ss29zpusr().f[1]++;
1057
- cov_1ss29zpusr().s[16]++;
1058
-
1051
+ cov_1ss29zpusr().s[17]++;
1059
1052
  if (!path) {
1060
1053
  cov_1ss29zpusr().b[15][0]++;
1061
- cov_1ss29zpusr().s[17]++;
1054
+ cov_1ss29zpusr().s[18]++;
1062
1055
  throw new Error("Path is required when running init.");
1063
1056
  } else {
1064
1057
  cov_1ss29zpusr().b[15][1]++;
1065
1058
  }
1066
-
1067
- cov_1ss29zpusr().s[18]++;
1068
-
1059
+ cov_1ss29zpusr().s[19]++;
1069
1060
  if (!adapterNpmName) {
1070
1061
  cov_1ss29zpusr().b[16][0]++;
1071
- cov_1ss29zpusr().s[19]++;
1062
+ cov_1ss29zpusr().s[20]++;
1072
1063
  throw new Error("The adapter's npm name is required when running init.");
1073
1064
  } else {
1074
1065
  cov_1ss29zpusr().b[16][1]++;
1075
1066
  }
1076
1067
  }
1068
+
1077
1069
  /**
1078
1070
  * CONFIG
1079
1071
  * Loads and returns the adapter config at key config.commitizen, if it exists
1080
1072
  */
1081
-
1082
-
1083
1073
  function loadAdapterConfig(cwd) {
1084
1074
  cov_1ss29zpusr().f[2]++;
1085
- let config = (cov_1ss29zpusr().s[20]++, configLoader.load(null, cwd));
1086
- cov_1ss29zpusr().s[21]++;
1087
-
1075
+ let config = (cov_1ss29zpusr().s[21]++, configLoader.load(null, cwd));
1076
+ cov_1ss29zpusr().s[22]++;
1088
1077
  if (config) {
1089
1078
  cov_1ss29zpusr().b[17][0]++;
1090
- cov_1ss29zpusr().s[22]++;
1079
+ cov_1ss29zpusr().s[23]++;
1091
1080
  return config;
1092
1081
  } else {
1093
1082
  cov_1ss29zpusr().b[17][1]++;