-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This reverts commit 66727ac.
- Loading branch information
1 parent
627170c
commit d8b9ae5
Showing
21 changed files
with
357 additions
and
1,944 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ node_modules | |
.nyc_output | ||
.idea | ||
.vscode | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
statements: 90 | ||
lines: 90 | ||
functions: 78 | ||
branches: 90 |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
'use strict' | ||
const { execWithOutput } = require('./execWithOutput') | ||
const { runSpawn } = require('./runSpawn') | ||
|
||
async function revertCommit(baseRef) { | ||
await execWithOutput('git', ['revert', 'HEAD']) | ||
await execWithOutput('git', ['push', 'origin', baseRef]) | ||
const run = runSpawn() | ||
|
||
await run('git', ['revert', 'HEAD']) | ||
await run('git', ['push', 'origin', baseRef]) | ||
} | ||
|
||
exports.revertCommit = revertCommit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict' | ||
|
||
const { spawn } = require('child_process') | ||
|
||
function runSpawn({ cwd } = {}) { | ||
return (cmd, args) => { | ||
return new Promise((resolve, reject) => { | ||
const cli = spawn(cmd, args, { cwd, env: process.env, shell: true }) | ||
cli.stdout.setEncoding('utf8') | ||
cli.stderr.setEncoding('utf8') | ||
|
||
let stdout = '' | ||
let stderr = '' | ||
cli.stdout.on('data', data => { | ||
stdout += data | ||
}) | ||
cli.stderr.on('data', data => { | ||
stderr += data | ||
}) | ||
cli.on('close', (code, signal) => { | ||
if (code === 0) { | ||
return resolve(stdout.trim()) | ||
} | ||
reject( | ||
new Error( | ||
`${cmd} ${args.join( | ||
' ' | ||
)} returned code ${code} and signal ${signal}\nSTDOUT: ${stdout}\nSTDERR: ${stderr}` | ||
) | ||
) | ||
}) | ||
}) | ||
} | ||
} | ||
|
||
exports.runSpawn = runSpawn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
'use strict' | ||
const { execWithOutput } = require('./execWithOutput') | ||
const { runSpawn } = require('./runSpawn') | ||
|
||
async function tagVersionInGit(version) { | ||
await execWithOutput('git', ['push', 'origin', `:refs/tags/${version}`]) | ||
await execWithOutput('git', ['tag', '-f', `"${version}"`]) | ||
await execWithOutput('git', ['push', 'origin', `--tags`]) | ||
const run = runSpawn() | ||
|
||
await run('git', ['push', 'origin', `:refs/tags/${version}`]) | ||
await run('git', ['tag', '-f', `"${version}"`]) | ||
await run('git', ['push', 'origin', `--tags`]) | ||
} | ||
|
||
exports.tagVersionInGit = tagVersionInGit |
Oops, something went wrong.