| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1c324d5 commit c458e84
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -368,12 +368,6 @@ const { spawn } = require('child_process'); | |||
| 368 | 368 | spawn(...common.pwdCommand, { stdio: ['pipe'] }); | |
| 369 | 369 | ``` | |
| 370 | 370 | ||
| 371 | - ### `rootDir` | ||
| 372 | - | ||
| 373 | - * [<string>][] | ||
| 374 | - | ||
| 375 | - Path to the 'root' directory. either `/` or `c:\\` (windows) | ||
| 376 | - | ||
| 377 | 371 | ### `runWithInvalidFD(func)` | |
| 378 | 372 | ||
| 379 | 373 | * `func` [<Function>][] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -114,8 +114,6 @@ const isOSX = process.platform === 'darwin'; | |||
| 114 | 114 | ||
| 115 | 115 | const isDumbTerminal = process.env.TERM === 'dumb'; | |
| 116 | 116 | ||
| 117 | - const rootDir = isWindows ? 'c:\\' : '/'; | ||
| 118 | - | ||
| 119 | 117 | const buildType = process.config.target_defaults ? | |
| 120 | 118 | process.config.target_defaults.default_configuration : | |
| 121 | 119 | 'Release'; | |
@@ -723,7 +721,6 @@ const common = { | |||
| 723 | 721 | platformTimeout, | |
| 724 | 722 | printSkipMessage, | |
| 725 | 723 | pwdCommand, | |
| 726 | - rootDir, | ||
| 727 | 724 | runWithInvalidFD, | |
| 728 | 725 | skip, | |
| 729 | 726 | skipIf32Bits, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,6 @@ const { | |||
| 19 | 19 | isOSX, | |
| 20 | 20 | enoughTestMem, | |
| 21 | 21 | enoughTestCpu, | |
| 22 | - rootDir, | ||
| 23 | 22 | buildType, | |
| 24 | 23 | localIPv6Hosts, | |
| 25 | 24 | opensslCli, | |
@@ -66,7 +65,6 @@ export { | |||
| 66 | 65 | isOSX, | |
| 67 | 66 | enoughTestMem, | |
| 68 | 67 | enoughTestCpu, | |
| 69 | - rootDir, | ||
| 70 | 68 | buildType, | |
| 71 | 69 | localIPv6Hosts, | |
| 72 | 70 | opensslCli, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,6 +21,9 @@ | |||
| 21 | 21 | ||
| 22 | 22 | 'use strict'; | |
| 23 | 23 | const common = require('../common'); | |
| 24 | + const tmpdir = require('../common/tmpdir'); | ||
| 25 | + tmpdir.refresh(); | ||
| 26 | + | ||
| 24 | 27 | const assert = require('assert'); | |
| 25 | 28 | const { spawn } = require('child_process'); | |
| 26 | 29 | ||
@@ -63,7 +66,7 @@ function testCwd(options, expectCode = 0, expectData) { | |||
| 63 | 66 | } | |
| 64 | 67 | ||
| 65 | 68 | // Assume these exist, and 'pwd' gives us the right directory back | |
| 66 | - testCwd({ cwd: common.rootDir }, 0, common.rootDir); | ||
| 69 | + testCwd({ cwd: tmpdir.path }, 0, tmpdir.path); | ||
| 67 | 70 | const shouldExistDir = common.isWindows ? process.env.windir : '/dev'; | |
| 68 | 71 | testCwd({ cwd: shouldExistDir }, 0, shouldExistDir); | |
| 69 | 72 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,6 +21,9 @@ | |||
| 21 | 21 | ||
| 22 | 22 | 'use strict'; | |
| 23 | 23 | const common = require('../common'); | |
| 24 | + const tmpdir = require('../common/tmpdir'); | ||
| 25 | + tmpdir.refresh(); | ||
| 26 | + | ||
| 24 | 27 | const assert = require('assert'); | |
| 25 | 28 | const { spawnSync } = require('child_process'); | |
| 26 | 29 | const { getSystemErrorName } = require('util'); | |
@@ -41,7 +44,7 @@ assert.deepStrictEqual(ret_err.spawnargs, ['bar']); | |||
| 41 | 44 | ||
| 42 | 45 | { | |
| 43 | 46 | // Test the cwd option | |
| 44 | - const cwd = common.rootDir; | ||
| 47 | + const cwd = tmpdir.path; | ||
| 45 | 48 | const response = spawnSync(...common.pwdCommand, { cwd }); | |
| 46 | 49 | ||
| 47 | 50 | assert.strictEqual(response.stdout.toString().trim(), cwd); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,6 +21,9 @@ | |||
| 21 | 21 | ||
| 22 | 22 | 'use strict'; | |
| 23 | 23 | const common = require('../common'); | |
| 24 | + const tmpdir = require('../common/tmpdir'); | ||
| 25 | + tmpdir.refresh(); | ||
| 26 | + | ||
| 24 | 27 | const assert = require('assert'); | |
| 25 | 28 | ||
| 26 | 29 | const { execFileSync, execSync, spawnSync } = require('child_process'); | |
@@ -99,7 +102,7 @@ const args = [ | |||
| 99 | 102 | // Verify that the cwd option works. | |
| 100 | 103 | // See https://github.com/nodejs/node-v0.x-archive/issues/7824. | |
| 101 | 104 | { | |
| 102 | - const cwd = common.rootDir; | ||
| 105 | + const cwd = tmpdir.path; | ||
| 103 | 106 | const cmd = common.isWindows ? 'echo %cd%' : 'pwd'; | |
| 104 | 107 | const response = execSync(cmd, { cwd }); | |
| 105 | 108 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments