diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2018-03-14 10:17:15 +0100 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2018-03-14 10:17:15 +0100 |
commit | 551dcb5cc09d2f400783183b42c32acd48bef5c7 (patch) | |
tree | 970db5561a0ab3a7830419728b6f43023bdd29dc /scripts/frontend/frontend_script_utils.js | |
parent | 535f9b5be9bc05f517070f9e6800c906b61c9543 (diff) | |
download | gitlab-ce-tz-prettier-base.tar.gz |
Made speed optimisations to the scripttz-prettier-base
Documentation updates
Reverted config prettifiying
Diffstat (limited to 'scripts/frontend/frontend_script_utils.js')
-rw-r--r-- | scripts/frontend/frontend_script_utils.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/frontend/frontend_script_utils.js b/scripts/frontend/frontend_script_utils.js index c942812ca74..99628ba428d 100644 --- a/scripts/frontend/frontend_script_utils.js +++ b/scripts/frontend/frontend_script_utils.js @@ -5,7 +5,6 @@ const exec = (command, args) => { const options = { cwd: process.cwd(), env: process.env, - stdio: 'pipe', encoding: 'utf-8', }; return execFileSync(command, args, options); @@ -18,12 +17,14 @@ const execGitCmd = args => .split('\n'); module.exports = { - getChangedFiles: () => - execGitCmd([ + getChangedFiles: fileExtensionFilter => { + const gitOptions = [ 'diff', '--name-only', - '--no-renames', '--cached', '--diff-filter=ACMRTUB', - ]), + ]; + if (fileExtensionFilter) gitOptions.push(...fileExtensionFilter); + return execGitCmd(gitOptions); + }, }; |