monorepo-next 11.1.0 → 11.2.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.
- package/package.json +1 -1
- package/src/git.js +19 -13
package/package.json
CHANGED
package/src/git.js
CHANGED
@@ -15,26 +15,32 @@ async function git(args, options) {
|
|
15
15
|
cached,
|
16
16
|
} = options;
|
17
17
|
|
18
|
-
let
|
18
|
+
let cacheKey;
|
19
19
|
|
20
|
-
|
20
|
+
if (cached) {
|
21
|
+
cacheKey = getCacheKey(args, cwd);
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
} else {
|
25
|
-
debug(args, options);
|
23
|
+
if (cacheKey in cache) {
|
24
|
+
debug('Git cache hit.');
|
26
25
|
|
27
|
-
|
28
|
-
cwd,
|
29
|
-
})).stdout;
|
30
|
-
|
31
|
-
if (cached) {
|
32
|
-
cache[cacheKey] = stdout;
|
26
|
+
return cache[cacheKey];
|
33
27
|
}
|
34
28
|
|
35
|
-
debug(
|
29
|
+
debug('Git cache miss.');
|
36
30
|
}
|
37
31
|
|
32
|
+
debug(args, options);
|
33
|
+
|
34
|
+
let stdout = (await execa('git', args, {
|
35
|
+
cwd,
|
36
|
+
})).stdout;
|
37
|
+
|
38
|
+
if (cached) {
|
39
|
+
cache[cacheKey] = stdout;
|
40
|
+
}
|
41
|
+
|
42
|
+
debug(stdout);
|
43
|
+
|
38
44
|
return stdout;
|
39
45
|
}
|
40
46
|
|