Skip to content

Commit

Permalink
fix(package): update execa to version 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
greenkeeper[bot] authored and pvdlg committed Jun 25, 2019
1 parent 3394211 commit 39c4fd5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const debug = require('debug')('semantic-release:git');
*/
async function filterModifiedFiles(files, execaOpts) {
return files.length > 0
? (await execa.stdout('git', ['ls-files', '-m', '-o', ...files], execaOpts))
? (await execa('git', ['ls-files', '-m', '-o', ...files], execaOpts)).stdout
.split('\n')
.map(file => file.trim())
.filter(file => Boolean(file))
Expand Down Expand Up @@ -61,8 +61,8 @@ async function push(origin, branch, execaOpts) {
*
* @return {String} The sha of the head commit on the local repository
*/
function gitHead(execaOpts) {
return execa.stdout('git', ['rev-parse', 'HEAD'], execaOpts);
async function gitHead(execaOpts) {
return (await execa('git', ['rev-parse', 'HEAD'], execaOpts)).stdout;
}

module.exports = {filterModifiedFiles, add, gitHead, commit, push};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"aggregate-error": "^3.0.0",
"debug": "^4.0.0",
"dir-glob": "^2.0.0",
"execa": "^1.0.0",
"execa": "^2.0.0",
"fs-extra": "^8.0.0",
"globby": "^9.0.0",
"lodash": "^4.17.4",
Expand Down
12 changes: 7 additions & 5 deletions test/helpers/git-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ export async function initBareRepo(repositoryUrl, branch = 'master') {
* @returns {Array<Commit>} The created commits, in reverse order (to match `git log` order).
*/
export async function gitCommits(messages, execaOpts) {
await pReduce(messages, (_, message) =>
execa.stdout('git', ['commit', '-m', message, '--allow-empty', '--no-gpg-sign'], execaOpts)
await pReduce(
messages,
async (_, message) =>
(await execa('git', ['commit', '-m', message, '--allow-empty', '--no-gpg-sign'], execaOpts)).stdout
);
return (await gitGetCommits(undefined, execaOpts)).slice(0, messages.length);
}
Expand Down Expand Up @@ -151,7 +153,7 @@ export async function gitDetachedHead(repositoryUrl, head) {
* @return {String} The HEAD sha of the remote repository.
*/
export async function gitRemoteHead(repositoryUrl, execaOpts) {
return (await execa.stdout('git', ['ls-remote', repositoryUrl, 'HEAD'], execaOpts))
return (await execa('git', ['ls-remote', repositoryUrl, 'HEAD'], execaOpts)).stdout
.split('\n')
.filter(head => Boolean(head))
.map(head => head.match(/^(\S+)/)[1])[0];
Expand All @@ -165,7 +167,7 @@ export async function gitRemoteHead(repositoryUrl, execaOpts) {
* @return {Array<String>} Array of staged files path.
*/
export async function gitStaged(execaOpts) {
return (await execa.stdout('git', ['status', '--porcelain'], execaOpts))
return (await execa('git', ['status', '--porcelain'], execaOpts)).stdout
.split('\n')
.filter(status => status.startsWith('A '))
.map(status => status.match(/^A\s+(.+)$/)[1]);
Expand All @@ -180,7 +182,7 @@ export async function gitStaged(execaOpts) {
* @return {Array<String>} The list of files path included in the commit.
*/
export async function gitCommitedFiles(ref = 'HEAD', execaOpts) {
return (await execa.stdout('git', ['diff-tree', '-r', '--name-only', '--no-commit-id', '-r', ref], execaOpts))
return (await execa('git', ['diff-tree', '-r', '--name-only', '--no-commit-id', '-r', ref], execaOpts)).stdout
.split('\n')
.filter(file => Boolean(file));
}

0 comments on commit 39c4fd5

Please sign in to comment.