@netlify/git-utils 4.1.0 → 4.1.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.
- package/package.json +4 -4
- package/src/exec.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/git-utils",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Utility for dealing with modified, created, deleted files since a git commit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./src/main.js",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
},
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"execa": "^
|
|
49
|
-
"map-obj": "^
|
|
48
|
+
"execa": "^6.0.0",
|
|
49
|
+
"map-obj": "^5.0.0",
|
|
50
50
|
"micromatch": "^4.0.2",
|
|
51
51
|
"moize": "^6.0.0",
|
|
52
|
-
"path-exists": "^
|
|
52
|
+
"path-exists": "^5.0.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"ava": "^3.15.0"
|
package/src/exec.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import process from 'process'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { execaSync } from 'execa'
|
|
4
4
|
import moize from 'moize'
|
|
5
|
-
import
|
|
5
|
+
import { pathExistsSync } from 'path-exists'
|
|
6
6
|
|
|
7
7
|
// Fires the `git` binary. Memoized.
|
|
8
8
|
const mGit = function (args, cwd) {
|
|
9
9
|
const cwdA = safeGetCwd(cwd)
|
|
10
10
|
try {
|
|
11
|
-
const { stdout } =
|
|
11
|
+
const { stdout } = execaSync('git', args, { cwd: cwdA })
|
|
12
12
|
return stdout
|
|
13
13
|
} catch (error) {
|
|
14
14
|
// The child process `error.message` includes stderr and stdout output which most of the times contains duplicate
|
|
@@ -24,7 +24,7 @@ export const git = moize(mGit, { isDeepEqual: true, maxSize: 1e3 })
|
|
|
24
24
|
const safeGetCwd = function (cwd) {
|
|
25
25
|
const cwdA = getCwdValue(cwd)
|
|
26
26
|
|
|
27
|
-
if (!
|
|
27
|
+
if (!pathExistsSync(cwdA)) {
|
|
28
28
|
throw new Error(`Current directory does not exist: ${cwdA}`)
|
|
29
29
|
}
|
|
30
30
|
|