| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 924f346 commit bb2de4a
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -376,24 +376,12 @@ Path to the 'root' directory. either `/` or `c:\\` (windows) | |||
| 376 | 376 | ||
| 377 | 377 | Logs '1..0 # Skipped: ' + `msg` | |
| 378 | 378 | ||
| 379 | - ### spawnCat(options) | ||
| 380 | - * `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) | ||
| 381 | - * return [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) | ||
| 382 | - | ||
| 383 | - Platform normalizes the `cat` command. | ||
| 384 | - | ||
| 385 | 379 | ### spawnPwd(options) | |
| 386 | 380 | * `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) | |
| 387 | 381 | * return [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) | |
| 388 | 382 | ||
| 389 | 383 | Platform normalizes the `pwd` command. | |
| 390 | 384 | ||
| 391 | - ### spawnSyncCat(options) | ||
| 392 | - * `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) | ||
| 393 | - * return [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) | ||
| 394 | - | ||
| 395 | - Synchronous version of `spawnCat`. | ||
| 396 | - | ||
| 397 | 385 | ### spawnSyncPwd(options) | |
| 398 | 386 | * `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) | |
| 399 | 387 | * return [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -237,28 +237,6 @@ exports.ddCommand = function(filename, kilobytes) { | |||
| 237 | 237 | }; | |
| 238 | 238 | ||
| 239 | 239 | ||
| 240 | - exports.spawnCat = function(options) { | ||
| 241 | - const spawn = require('child_process').spawn; | ||
| 242 | - | ||
| 243 | - if (exports.isWindows) { | ||
| 244 | - return spawn('more', [], options); | ||
| 245 | - } else { | ||
| 246 | - return spawn('cat', [], options); | ||
| 247 | - } | ||
| 248 | - }; | ||
| 249 | - | ||
| 250 | - | ||
| 251 | - exports.spawnSyncCat = function(options) { | ||
| 252 | - const spawnSync = require('child_process').spawnSync; | ||
| 253 | - | ||
| 254 | - if (exports.isWindows) { | ||
| 255 | - return spawnSync('more', [], options); | ||
| 256 | - } else { | ||
| 257 | - return spawnSync('cat', [], options); | ||
| 258 | - } | ||
| 259 | - }; | ||
| 260 | - | ||
| 261 | - | ||
| 262 | 240 | exports.spawnPwd = function(options) { | |
| 263 | 241 | const spawn = require('child_process').spawn; | |
| 264 | 242 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,7 +34,7 @@ echo.on('close', common.mustCall((code, signal) => { | |||
| 34 | 34 | })); | |
| 35 | 35 | ||
| 36 | 36 | // Verify that shell features can be used | |
| 37 | - const cmd = common.isWindows ? 'echo bar | more' : 'echo bar | cat'; | ||
| 37 | + const cmd = 'echo bar | cat'; | ||
| 38 | 38 | const command = cp.spawn(cmd, { | |
| 39 | 39 | encoding: 'utf8', | |
| 40 | 40 | shell: true | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,7 @@ assert.strictEqual(echo.args[echo.args.length - 1].replace(/"/g, ''), | |||
| 23 | 23 | assert.strictEqual(echo.stdout.toString().trim(), 'foo'); | |
| 24 | 24 | ||
| 25 | 25 | // Verify that shell features can be used | |
| 26 | - const cmd = common.isWindows ? 'echo bar | more' : 'echo bar | cat'; | ||
| 26 | + const cmd = 'echo bar | cat'; | ||
| 27 | 27 | const command = cp.spawnSync(cmd, {shell: true}); | |
| 28 | 28 | ||
| 29 | 29 | assert.strictEqual(command.stdout.toString().trim(), 'bar'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ const assert = require('assert'); | |||
| 4 | 4 | ||
| 5 | 5 | const spawn = require('child_process').spawn; | |
| 6 | 6 | ||
| 7 | - const cat = spawn(common.isWindows ? 'more' : 'cat'); | ||
| 7 | + const cat = spawn('cat'); | ||
| 8 | 8 | cat.stdin.write('hello'); | |
| 9 | 9 | cat.stdin.write(' '); | |
| 10 | 10 | cat.stdin.write('world'); | |
@@ -33,9 +33,5 @@ cat.on('exit', common.mustCall(function(status) { | |||
| 33 | 33 | })); | |
| 34 | 34 | ||
| 35 | 35 | cat.on('close', common.mustCall(function() { | |
| 36 | - if (common.isWindows) { | ||
| 37 | - assert.strictEqual('hello world\r\n', response); | ||
| 38 | - } else { | ||
| 39 | - assert.strictEqual('hello world', response); | ||
| 40 | - } | ||
| 36 | + assert.strictEqual('hello world', response); | ||
| 41 | 37 | })); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - const common = require('../common'); | ||
| 2 | + require('../common'); | ||
| 3 | 3 | const assert = require('assert'); | |
| 4 | 4 | const spawn = require('child_process').spawn; | |
| 5 | 5 | ||
@@ -31,5 +31,5 @@ function grandparent() { | |||
| 31 | 31 | ||
| 32 | 32 | function parent() { | |
| 33 | 33 | // should not immediately exit. | |
| 34 | - common.spawnCat({ stdio: 'inherit' }); | ||
| 34 | + spawn('cat', [], { stdio: 'inherit' }); | ||
| 35 | 35 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,7 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | const common = require('../common'); | |
| 3 | 3 | const assert = require('assert'); | |
| 4 | + const spawnSync = require('child_process').spawnSync; | ||
| 4 | 5 | ||
| 5 | 6 | let options = {stdio: ['pipe']}; | |
| 6 | 7 | let child = common.spawnPwd(options); | |
@@ -15,7 +16,7 @@ assert.strictEqual(child.stdout, null); | |||
| 15 | 16 | assert.strictEqual(child.stderr, null); | |
| 16 | 17 | ||
| 17 | 18 | options = {stdio: 'ignore'}; | |
| 18 | - child = common.spawnSyncCat(options); | ||
| 19 | + child = spawnSync('cat', [], options); | ||
| 19 | 20 | assert.deepStrictEqual(options, {stdio: 'ignore'}); | |
| 20 | 21 | ||
| 21 | 22 | assert.throws(() => { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments