UNPKG

2.69 kBJavaScriptView Raw
1"use strict";
2
3var cov_v1ucos01h = function () {
4 var path = "/home/travis/build/commitizen/cz-cli/src/git/add.js";
5 var hash = "de42aff6417c2d8c31ffa220f836616b163f9dfc";
6 var global = new Function("return this")();
7 var gcv = "__coverage__";
8 var coverageData = {
9 path: "/home/travis/build/commitizen/cz-cli/src/git/add.js",
10 statementMap: {
11 "0": {
12 start: {
13 line: 12,
14 column: 2
15 },
16 end: {
17 line: 12,
18 column: 65
19 }
20 },
21 "1": {
22 start: {
23 line: 19,
24 column: 2
25 },
26 end: {
27 line: 19,
28 column: 70
29 }
30 }
31 },
32 fnMap: {
33 "0": {
34 name: "addPath",
35 decl: {
36 start: {
37 line: 11,
38 column: 9
39 },
40 end: {
41 line: 11,
42 column: 16
43 }
44 },
45 loc: {
46 start: {
47 line: 11,
48 column: 28
49 },
50 end: {
51 line: 13,
52 column: 1
53 }
54 },
55 line: 11
56 },
57 "1": {
58 name: "addFile",
59 decl: {
60 start: {
61 line: 18,
62 column: 9
63 },
64 end: {
65 line: 18,
66 column: 16
67 }
68 },
69 loc: {
70 start: {
71 line: 18,
72 column: 38
73 },
74 end: {
75 line: 20,
76 column: 1
77 }
78 },
79 line: 18
80 }
81 },
82 branchMap: {},
83 s: {
84 "0": 0,
85 "1": 0
86 },
87 f: {
88 "0": 0,
89 "1": 0
90 },
91 b: {},
92 _coverageSchema: "43e27e138ebf9cfc5966b082cf9a028302ed4184",
93 hash: "de42aff6417c2d8c31ffa220f836616b163f9dfc"
94 };
95 var coverage = global[gcv] || (global[gcv] = {});
96
97 if (coverage[path] && coverage[path].hash === hash) {
98 return coverage[path];
99 }
100
101 return coverage[path] = coverageData;
102}();
103
104Object.defineProperty(exports, "__esModule", {
105 value: true
106});
107exports.addPath = addPath;
108exports.addFile = addFile;
109
110var _child_process = _interopRequireDefault(require("child_process"));
111
112function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
113
114/**
115 * Synchronously adds a path to git staging
116 */
117function addPath(repoPath) {
118 cov_v1ucos01h.f[0]++;
119 cov_v1ucos01h.s[0]++;
120
121 _child_process.default.spawnSync('git', ['add', '.'], {
122 cwd: repoPath
123 });
124}
125/**
126 * Synchronously adds a file to git staging
127 */
128
129
130function addFile(repoPath, filename) {
131 cov_v1ucos01h.f[1]++;
132 cov_v1ucos01h.s[1]++;
133
134 _child_process.default.spawnSync('git', ['add', filename], {
135 cwd: repoPath
136 });
137}
\No newline at end of file