gulp-shell
Advanced tools
Comparing version 0.4.3 to 0.5.0
17
index.js
@@ -23,2 +23,3 @@ var _ = require('lodash') | ||
quiet: false, | ||
interactive: false, | ||
cwd: process.cwd(), | ||
@@ -46,5 +47,7 @@ maxBuffer: 16 * 1024 * 1024 | ||
}, function (error, stdout, stderr) { | ||
process.stdin.unpipe(child.stdin) | ||
process.stdin.resume() | ||
process.stdin.pause() | ||
if (options.interactive) { | ||
process.stdin.unpipe(child.stdin) | ||
process.stdin.resume() | ||
process.stdin.pause() | ||
} | ||
@@ -67,5 +70,7 @@ if (error && !options.ignoreErrors) { | ||
process.stdin.resume() | ||
process.stdin.setEncoding('utf8') | ||
process.stdin.pipe(child.stdin) | ||
if (options.interactive) { | ||
process.stdin.resume() | ||
process.stdin.setEncoding('utf8') | ||
process.stdin.pipe(child.stdin) | ||
} | ||
@@ -72,0 +77,0 @@ if (!options.quiet) { |
{ | ||
"name": "gulp-shell", | ||
"version": "0.4.3", | ||
"version": "0.5.0", | ||
"description": "A handy command line interface for gulp", | ||
@@ -27,9 +27,9 @@ "main": "index.js", | ||
"devDependencies": { | ||
"chai": "~3.2.0", | ||
"chai": "~3.3.0", | ||
"coveralls": "~2.11.2", | ||
"eslint": "~1.3.0", | ||
"eslint": "~1.6.0", | ||
"gulp": "~3.9.0", | ||
"istanbul": "~0.3.14", | ||
"mocha": "~2.2.5", | ||
"mocha-lcov-reporter": "0.0.2" | ||
"mocha": "~2.3.3", | ||
"mocha-lcov-reporter": "1.0.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "dependencies": { |
@@ -7,11 +7,13 @@ # gulp-shell | ||
[![Dependency Status][david-dm-image]][david-dm-url] | ||
[![Downloads][downloads-image]][npm-url] | ||
[npm-url]: https://badge.fury.io/js/gulp-shell | ||
[npm-image]: https://badge.fury.io/js/gulp-shell.png | ||
[npm-url]: https://npmjs.org/package/gulp-shell | ||
[npm-image]: https://img.shields.io/npm/v/gulp-shell.svg | ||
[travis-url]: https://travis-ci.org/sun-zheng-an/gulp-shell | ||
[travis-image]: https://travis-ci.org/sun-zheng-an/gulp-shell.png?branch=master | ||
[travis-image]: https://img.shields.io/travis/sun-zheng-an/gulp-shell/master.svg | ||
[coveralls-url]: https://coveralls.io/r/sun-zheng-an/gulp-shell | ||
[coveralls-image]: https://coveralls.io/repos/sun-zheng-an/gulp-shell/badge.png?branch=master | ||
[coveralls-image]: https://img.shields.io/coveralls/sun-zheng-an/gulp-shell/master.svg | ||
[david-dm-url]: https://david-dm.org/sun-zheng-an/gulp-shell | ||
[david-dm-image]: https://david-dm.org/sun-zheng-an/gulp-shell.png?theme=shields.io | ||
[david-dm-image]: https://img.shields.io/david/sun-zheng-an/gulp-shell.svg | ||
[downloads-image]: https://img.shields.io/npm/dm/gulp-shell.svg | ||
@@ -102,2 +104,10 @@ > A handy command line interface for gulp | ||
#### options.interactive | ||
type: `Boolean` | ||
default: `false` | ||
Turn it on only if you need to run some interactive commands. | ||
#### options.cwd | ||
@@ -104,0 +114,0 @@ |
@@ -44,11 +44,2 @@ /*eslint-env mocha */ | ||
it('reads input', function (done) { | ||
var stream = shell(['read s; echo $s']) | ||
process.stdin.push('something\n') | ||
expectToOutput('something', done) | ||
stream.write(fakeFile) | ||
}) | ||
it('executes command after interpolation', function (done) { | ||
@@ -124,2 +115,13 @@ var stream = shell(['echo <%= file.path %>']) | ||
describe('interactive', function () { | ||
it('reads input when `interactive` == true', function (done) { | ||
var stream = shell(['read s; echo $s'], {interactive: true}) | ||
process.stdin.push('something\n') | ||
expectToOutput('something', done) | ||
stream.write(fakeFile) | ||
}) | ||
}) | ||
describe('errorMessage', function () { | ||
@@ -160,5 +162,3 @@ it('allows for custom messages', function (done) { | ||
}) | ||
}) | ||
describe('cwd', function () { | ||
it('uses the process current working directory when `cwd` is not passed', function (done) { | ||
@@ -165,0 +165,0 @@ var stream = shell(['pwd']) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14257
227
150