-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from theenadayalank/feature_skip_rerunning_tasks
[FEATURE] Cache successful linted commit hash
- Loading branch information
Showing
5 changed files
with
121 additions
and
65 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
const { spawnChildProcess } = require("./common"); | ||
const { execChildProcess } = require("./common"); | ||
|
||
module.exports = function fetchGitDiff( baseBranch = "master" ) { | ||
|
||
// git command to pull out the changed file names between current branch and base branch (Excluded delelted files which cannot be fetched now) | ||
let command = `git diff --relative --name-only --diff-filter=d ${baseBranch}...HEAD`; | ||
|
||
return new Promise( (resolve, reject) => { | ||
spawnChildProcess({ command }, ({ hasErrors = false, output = '' }) => { | ||
let fileList = []; | ||
if (hasErrors) { | ||
reject(`\n Fetching committed file list process has been stopped with the following error: \n ${output}`); | ||
} | ||
output.split("\n").forEach(filename => { | ||
filename ? fileList.push(filename) : null; | ||
return execChildProcess({ command }) | ||
.then((result = '') => { | ||
let fileList = result.split('\n'); | ||
resolve(fileList); | ||
}) | ||
.catch((err) => { | ||
reject(`\n Fetching committed file list process has been stopped with the following error: \n ${err}`); | ||
}); | ||
resolve(fileList); | ||
}); | ||
}); | ||
}; |
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