Brandon Freitag
dcead1be86
Add "encoding" option to exec ( #763 )
...
* Add 'encoding' option to shell.exec
* Add 'encoding' option to docs
* Add exec encoding option tests
* Clarify use of encoding with fs.readFileSync
* Add check for stderr buffer
2017-09-13 16:18:28 -07:00
Nate Fischer
2ee83ebf74
refactor(test): update AVA and refactor tests ( #760 )
...
This updates tests for `AVA` 19.0.0+.
`AVA` 0.18.0 has a breaking change which changes the current working directory
for tests. As a result, we need to change 'resources' -> 'test/resources' (and
similar path changes).
`AVA` 0.19.0 has a breaking change that all tests must run at least one assert.
This breaking change was already resolved by #746 , so no change was necessary in
this PR.
This updates to `AVA` 0.21.0, since there are no other breaking changes.
2017-08-11 11:03:13 -07:00
Nate Fischer
38b57c8942
chore: add skipOnWin and skipOnUnix test helpers ( #746 )
...
This adds `skipOnWin` and `skipOnUnix` to help us manage our platform-dependent
tests. These methods give a nice warning message when we skip tests. We may also
consider adding warnings when running platform-dependent tests.
Part of the motivation for this is if we ever update to AVA v0.19. This version
requires at least one assertion per test case. While this could be disabled with
an AVA setting, we instead benefit from warnings for any case when we
unintentionally skip assertions.
This adds chalk as a dev dependency to enable colored messages.
2017-06-18 11:51:01 -07:00
Nate Fischer
5823ab18bb
test(exec): add tests for coverage ( #744 )
...
* test(exec): add tests for coverage
No logic change.
This adds one test to cover some missing lines, and adds some `istanbul ignore`
directives.
I see 100% line coverage for `src/exec.js` when running:
```sh
$ nyc --reporter=text --reporter=lcov ava --serial test/exec.js`
```
Fixes #742
* Fix lint
2017-06-17 19:09:01 -07:00
Nate Fischer
f74e783890
chore: remove v0.12 and iojs support ( #648 )
...
Fixes #647
2017-06-06 21:10:27 -07:00
Nate Fischer
d8ac4d3f02
refactor: remove unnecessary common.js imports ( #703 )
...
No change in logic.
This removes unnecessary imports of `common.js` in favor of the `shell`
package.
2017-04-15 00:51:29 -07:00
Nate Fischer
4c48631d74
refactor: create common.execPath ( #636 )
...
Switch to using common.execPath instead of process.execPath directly and warn
electron users if we were unable to find the correct path to NodeJS.
2017-01-08 13:52:39 -08:00
Brandon Freitag
7fa4b995bf
Finalize moving to ava ( #630 )
...
* Move ava-test/ directory to test/
* Remove unnecessary run-tests.js script
* Run only ava during npm test script
2016-12-20 11:27:02 -08:00
Nate Fischer
6b15577541
test: refactor exec tests to AVA ( #574 )
...
* test: refactor exec tests to AVA
* change single quotes to double quotes for Win
2016-11-30 21:14:49 -08:00
Nate Fischer
2395214fee
chore: switch to eslint ( #504 )
...
* chore: switch to eslint
* fix: works on older versions of NodeJS now
* chore: fix curly braces
* chore: fix indents and remove jshint references
2016-08-07 12:16:29 -07:00
Nate Fischer
db20acebfb
Switch to process.execPath over 'node'
2016-03-10 17:06:32 -08:00
Nate Fischer
6ebc2d3db7
refactor(shellstring): return consistent objects
...
- fix(string): no longer overrides string prototype
- exec() now returns a ShellString object
2016-02-19 14:54:30 -08:00
Jason McLaurin
6bf7d77ecf
change config.fatal to throw an exception instead of terminating the node.js process
2016-02-16 11:19:25 -06:00
Ari Porad
7531d3a0ee
Merge pull request #354 from shelljs/fix-exec-temp-files
...
fix(exec): temp files are now cleaned up
2016-02-14 08:49:57 -08:00
Nate Fischer
b63dde5d1a
fix(exec): now actually supports shell option
2016-02-13 20:45:32 -08:00
Nate Fischer
fed412ff1b
fix(exec): temp files are now cleaned up
2016-02-11 15:20:32 -08:00
Nate Fischer
dc79d7eff0
fix(touch): enhance parseOptions and fix touch's -r flag
2016-02-04 15:41:48 -08:00
Nate Fischer
058bb679b0
feat(exec): allow all exec options to pass through
2016-02-03 20:54:41 -08:00
Nate Fischer
8a7f7ceec4
add exec.stdout
...
Change `exec.output` to `exec.stdout` and deprecate `output`.
2016-01-12 17:14:13 -08:00
Nate Fischer
74f1ff8748
Commands that have multiple errors now produce cleaner log output. Errors are
...
echoed to stderr. exec() supports a new stderr field.
2016-01-12 17:02:19 -08:00
Artur Adib
21f721cb45
more stringent jshint; catch leaks/undefs
2013-09-21 10:12:28 -04:00
Nils Bunger
d97c34627c
Make shell.exec() treat process error return codes as shelljs errors
2013-09-08 17:16:08 -07:00
Deepak Thukral
7b9ee5a41d
Kept existing options and re-wrote the test case.
2013-03-11 13:10:05 +01:00
Deepak Thukral
a91aa8cc9a
exec with callback failed with slient param was defined
2013-03-11 12:30:44 +01:00
Artur Adib
35211d0783
Merge pull request #42 from danielepolencic/master
...
Fix single/double quotes in exec
2012-12-01 11:09:17 -08:00
Artur Adib
e4d9dabe52
introducing config.silent, config.fatal
...
deprecates silent()
2012-12-01 09:48:23 -05:00
Daniele Polencic
0409bd7a27
new test for quotes escaping
2012-11-13 09:52:53 +00:00
Artur Adib
99b9b759fa
closes #31
2012-09-28 15:45:34 -04:00
Artur Adib
38a0bde0a9
exec async now returns child proc obj
2012-05-24 22:10:21 -04:00
Artur Adib
5c4f3609f3
oops
2012-04-16 11:03:35 -04:00
Artur Adib
44d9625326
test/exec.js: avoid intermittent failures
2012-04-16 11:02:23 -04:00
Artur Adib
94caeb20fd
trying to fix async tests for exec()
2012-03-27 20:21:35 -04:00
Artur Adib
2f3bce71d1
echo() overrides silent()
2012-03-27 18:51:02 -04:00
Artur Adib
687e19044c
fix: exec()'s {silent} overrides global silent()
2012-03-27 18:16:15 -04:00
Artur Adib
11614fd516
Deprecated: verbose() and exists()
2012-03-15 14:20:10 -04:00
Artur Adib
534c05dc25
exec()
2012-03-02 11:17:05 -05:00