Skip to content

Commit 39c4fd5

Browse files
greenkeeper[bot]pvdlg
authored andcommittedJun 25, 2019
fix(package): update execa to version 2.0.0
1 parent 3394211 commit 39c4fd5

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed
 

‎lib/git.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const debug = require('debug')('semantic-release:git');
1111
*/
1212
async function filterModifiedFiles(files, execaOpts) {
1313
return files.length > 0
14-
? (await execa.stdout('git', ['ls-files', '-m', '-o', ...files], execaOpts))
14+
? (await execa('git', ['ls-files', '-m', '-o', ...files], execaOpts)).stdout
1515
.split('\n')
1616
.map(file => file.trim())
1717
.filter(file => Boolean(file))
@@ -61,8 +61,8 @@ async function push(origin, branch, execaOpts) {
6161
*
6262
* @return {String} The sha of the head commit on the local repository
6363
*/
64-
function gitHead(execaOpts) {
65-
return execa.stdout('git', ['rev-parse', 'HEAD'], execaOpts);
64+
async function gitHead(execaOpts) {
65+
return (await execa('git', ['rev-parse', 'HEAD'], execaOpts)).stdout;
6666
}
6767

6868
module.exports = {filterModifiedFiles, add, gitHead, commit, push};

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"aggregate-error": "^3.0.0",
2929
"debug": "^4.0.0",
3030
"dir-glob": "^2.0.0",
31-
"execa": "^1.0.0",
31+
"execa": "^2.0.0",
3232
"fs-extra": "^8.0.0",
3333
"globby": "^9.0.0",
3434
"lodash": "^4.17.4",

‎test/helpers/git-utils.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ export async function initBareRepo(repositoryUrl, branch = 'master') {
6060
* @returns {Array<Commit>} The created commits, in reverse order (to match `git log` order).
6161
*/
6262
export async function gitCommits(messages, execaOpts) {
63-
await pReduce(messages, (_, message) =>
64-
execa.stdout('git', ['commit', '-m', message, '--allow-empty', '--no-gpg-sign'], execaOpts)
63+
await pReduce(
64+
messages,
65+
async (_, message) =>
66+
(await execa('git', ['commit', '-m', message, '--allow-empty', '--no-gpg-sign'], execaOpts)).stdout
6567
);
6668
return (await gitGetCommits(undefined, execaOpts)).slice(0, messages.length);
6769
}
@@ -151,7 +153,7 @@ export async function gitDetachedHead(repositoryUrl, head) {
151153
* @return {String} The HEAD sha of the remote repository.
152154
*/
153155
export async function gitRemoteHead(repositoryUrl, execaOpts) {
154-
return (await execa.stdout('git', ['ls-remote', repositoryUrl, 'HEAD'], execaOpts))
156+
return (await execa('git', ['ls-remote', repositoryUrl, 'HEAD'], execaOpts)).stdout
155157
.split('\n')
156158
.filter(head => Boolean(head))
157159
.map(head => head.match(/^(\S+)/)[1])[0];
@@ -165,7 +167,7 @@ export async function gitRemoteHead(repositoryUrl, execaOpts) {
165167
* @return {Array<String>} Array of staged files path.
166168
*/
167169
export async function gitStaged(execaOpts) {
168-
return (await execa.stdout('git', ['status', '--porcelain'], execaOpts))
170+
return (await execa('git', ['status', '--porcelain'], execaOpts)).stdout
169171
.split('\n')
170172
.filter(status => status.startsWith('A '))
171173
.map(status => status.match(/^A\s+(.+)$/)[1]);
@@ -180,7 +182,7 @@ export async function gitStaged(execaOpts) {
180182
* @return {Array<String>} The list of files path included in the commit.
181183
*/
182184
export async function gitCommitedFiles(ref = 'HEAD', execaOpts) {
183-
return (await execa.stdout('git', ['diff-tree', '-r', '--name-only', '--no-commit-id', '-r', ref], execaOpts))
185+
return (await execa('git', ['diff-tree', '-r', '--name-only', '--no-commit-id', '-r', ref], execaOpts)).stdout
184186
.split('\n')
185187
.filter(file => Boolean(file));
186188
}

0 commit comments

Comments
 (0)
Please sign in to comment.