Skip to content

Commit

Permalink
fix(package): update execa to be compatible with sem-rel 15.13.28
Browse files Browse the repository at this point in the history
closes #7
  • Loading branch information
antongolub committed Oct 27, 2019
1 parent 1e3ece5 commit 069bb4e
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 87 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/node_modules/
/coverage/
/coverage/
*.log
2 changes: 1 addition & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

// Execa hook.
if (require("yargs").argv.execasync) {
if (process.argv.includes("--execasync")) {
require("../lib/execaHook").hook();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/execaHook.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// NOTE this workaround forces execa calls to be always sync
// Discussion: https://github.com/semantic-release/semantic-release/issues/193#issuecomment-462063871

const execa = require("execa");
const ritm = require("require-in-the-middle");
const execa = require("execa");

let interceptor;

Expand Down
4 changes: 2 additions & 2 deletions lib/getCommitsFiltered.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { relative } = require("path");
const { relative, resolve } = require("path");
const { check, ValueError } = require("./blork");
const gitLogParser = require("git-log-parser");
const getStream = require("get-stream");
Expand Down Expand Up @@ -30,7 +30,7 @@ async function getCommitsFiltered(cwd, dir, lastHead = undefined) {
if (dir === cwd) throw new ValueError("dir: Must not be equal to cwd", dir);

// Get top-level Git directory as it might be higher up the tree than cwd.
const root = await execa.stdout("git", ["rev-parse", "--show-toplevel"], { cwd });
const root = (await execa("git", ["rev-parse", "--show-toplevel"], { cwd })).stdout;

// Add correct fields to gitLogParser.
Object.assign(gitLogParser.fields, {
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,15 @@
"bash-glob": "^2.0.0",
"blork": "^9.1.1",
"cosmiconfig": "^5.1.0",
"execa": "^1.0.0",
"execa": "^3.2.0",
"get-stream": "^4.1.0",
"git-log-parser": "^1.2.0",
"require-in-the-middle": "^4.0.0",
"semantic-release": "^15.12.4",
"semver": "^5.6.0",
"signale": "^1.2.0",
"stream-buffers": "^3.0.2",
"tempy": "^0.2.1",
"yargs": "^13.2.2"
"tempy": "^0.2.1"
},
"devDependencies": {
"@commitlint/config-conventional": "^7.3.1",
Expand Down
2 changes: 1 addition & 1 deletion test/bin/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("multi-semantic-release CLI", () => {
const filepath = `${__dirname}/../../bin/cli.js`;

// Run via command line.
const out = await execa.stdout("node", [filepath], { cwd });
const out = (await execa("node", [filepath], { cwd })).stdout;
expect(out).toMatch("Started multirelease! Loading 4 packages...");
expect(out).toMatch("Released 4 of 4 packages, semantically!");
});
Expand Down
Loading

0 comments on commit 069bb4e

Please sign in to comment.