|
1 | 1 | "use strict"; |
2 | 2 |
|
3 | | -const fs = require("fs"); |
4 | | -const path = require("path"); |
5 | 3 | const files = require("./files"); |
6 | 4 |
|
7 | | -const mocksDir = path.resolve("test", "fixtures", "mocks"); |
8 | | - |
9 | | -// Ensure that the mock binaries are executable |
10 | | -fs.chmodSync(path.join(mocksDir, "git"), "0777"); |
11 | | -fs.chmodSync(path.join(mocksDir, "npm"), "0777"); |
12 | | - |
13 | | -// Inject our mocks directory path into the PATH variable, |
14 | | -// so that version-bump-prompt runs our mock `git` and `npm` binaries |
15 | | -// instead of the real ones. |
16 | | -let otherPaths = getEnvPath(); |
17 | | -process.env.PATH = mocksDir + path.delimiter + otherPaths; // eslint-disable-line no-path-concat |
18 | | - |
19 | 5 | const mocks = module.exports = { |
20 | 6 | /** |
21 | 7 | * Returns information about each time `git` was executed. |
@@ -70,20 +56,6 @@ const mocks = module.exports = { |
70 | 56 | }, |
71 | 57 | }; |
72 | 58 |
|
73 | | - |
74 | | -/** |
75 | | - * Returns the PATH environment variable, case-insensitively |
76 | | - */ |
77 | | -function getEnvPath () { |
78 | | - let keys = Object.keys(process.env); |
79 | | - |
80 | | - for (let key of keys) { |
81 | | - if (key.toUpperCase() === "PATH") { |
82 | | - return process.env[key]; |
83 | | - } |
84 | | - } |
85 | | -} |
86 | | - |
87 | 59 | /** |
88 | 60 | * Adds quotes around an argument if it contains whitespace characters |
89 | 61 | * |
|
0 commit comments