192 Commits

Author SHA1 Message Date
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
Nate Fischer
ac0ff873f1 refactor: add config.reset() and .resetForTesting() (#641)
Add .reset() and .resetForTesting() to shell.config and use .resetForTesting()
as a standard set-up for unit tests.
2017-01-07 22:40:38 -08:00
Nate Fischer
2da9ab55be fix: allow non-normalized paths as input to mkdir (#635)
Adds tests to make sure that non-normalized paths (i.e. path/to/./dir) are
valid for a few commands, including mkdir() which previously failed when given
the -p flag.

Fixes #634
2017-01-07 18:06:15 -08:00
Brandon Freitag
ded1a3e4a3 Fix: rm behavior regarding symlinks (#598)
* Treat files and symlinks separately

* Remove -f flag from dir symlink test

* Simplify control flow
2016-12-08 23:45:35 -08:00
Brandon Freitag
5ded216dc2 Use Object.assign if possible (#593)
* Fix typo

* Set objectAssign to Object.assign if defined

* Use correct terminology
2016-12-07 12:11:40 -08:00
Brandon Freitag
e4b71f0a23 Add ability to configure error from parseOptions (#594) 2016-12-06 23:52:02 -08:00
Brandon Freitag
12c103fc43 Update sed documentation regarding capture groups (#558)
* Update sed documentation regarding capture groups

* Remove unix sed example for brevity

* Regen README
2016-11-17 21:37:42 -08:00
Nate Fischer
4a1bce8815 fix: handle code-less errors more carefully in exec (#554)
If an error exists, but has no error code, it defaults to 1 (a common code for
most Unix commands). Tests have been omitted since this is an edge case that is
difficult to reproduce.

Fixes #536
2016-11-16 21:51:08 -08:00
Nate Fischer
7a82946a8d fix: maxdepth doesn't limit total number of copies (#549)
* fix: maxdepth doesn't limit total number of copies

Prevent maxdepth from limiting the total number of copies, only allow it to
limit the maximum depth

Fixes #547

* refactor: make `depth` be its own argument
2016-11-10 00:18:04 -08:00
Brandon Freitag
9bc498e512 Fix lint warning (#543)
* Fix lint warning

* Add a TODO to refactor loop
2016-11-01 21:38:00 -07:00
Nate Fischer
4975b54a4f feat: plugin.error() takes an options parameter (#535)
This implements the following options: `continue`, `code`, `prefix`, & `silent`.

Fixes #522, #523
2016-10-23 23:17:42 -07:00
Gyandeep Singh
93ea025755 Revert "refactor: replace fs.existsSync" (fixes #531) (#532)
This reverts commit ab8cf5a8e027b28fc7b784587e4339d2b6d0f08f.
2016-10-17 20:14:43 -07:00
Gyandeep Singh
9bf98dece9 Fix: Remove default glob from shell.test (fixes #529) (#530) 2016-10-17 11:00:04 -07:00
Nate Fischer
d057e075a7 feat: cp -u option (#527)
Only update when the source file is older than the destination, or the
destination file is missing.

Fixes #526
2016-10-14 15:39:59 -07:00
Nate Fischer
45f719de75 fix: echo supports -e option properly (#511) 2016-08-23 19:36:05 -07:00
Nate Fischer
ab8cf5a8e0 refactor: replace fs.existsSync (#509)
* refactor: replace fs.existsSync

* fix: add support for v0.10
2016-08-20 18:28:49 -07:00
Nate Fischer
a0c9032072 refactor: readFromPipe() requires no arguments (#506) 2016-08-13 15:50:31 -07:00
Nate Fischer
902f92ab5b feat: add overWrite option for commands (#503)
* feat: add overWrite option for commands

* fix: throws an error if a command is overwritten
2016-08-08 11:44:16 -07: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
Charles Read
cdd21c62f1 fixed head/tail readme (#499) 2016-07-31 12:58:21 -07:00
Nate Fischer
d4111763a9 refactor: glob by default for commands (#492) 2016-07-27 16:43:01 -07:00
Nate Fischer
06ae7d9b88 fix: conflicting options now properly override each other (#489) 2016-07-27 09:31:38 -07:00
Nate Fischer
add14adbf4 refactor: switch common.extend() to Object.assign ponyfill (#490) 2016-07-27 09:28:11 -07:00
Nate Fischer
11141a35ba refactor: switch from notUnix to unix in wrap() (#491) 2016-07-27 09:27:12 -07:00
Nate Fischer
7b9ec7fb66 refactor: allow pipeOnly commands (methods on ShellStrings) (#493) 2016-07-27 09:26:45 -07:00
Nate Fischer
9c7e6a892a refactor: add wrapOutput option to auto-ShellString-ify command output (#481) 2016-07-24 18:20:36 -07:00
Nate Fischer
e438e61f45 refactor: move option parsing into common.wrap() (#479)
* refactor: move option parsing into common.wrap()

* docs: update README
2016-07-24 17:52:51 -07:00
Nate Fischer
7b984e1c25 fix: mkdir for invalid perms does not kill process (#474)
* fix: mkdir for invalid perms does not kill process

* Re-throw exception in case it isn't `EACCES`
2016-07-24 16:58:45 -07:00
Nate Fischer
39fd6d1ed7 Fix mkdir malformed path (#477)
* Added recurs. mkdir dirname() failure check.

Prevents an infinite loop with malformed UNCs and/or permission problems.

* Now call common.error() instead of throwing (mkdir).

* refactor: clean up style
2016-07-23 16:21:59 -07:00
Nate Fischer
bd6f96db33 refactor: hook new uniq() command using new format (#478) 2016-07-23 10:56:26 -07:00
Shubham Joshi
3367e0c6c7 feat(command): new command: uniq() (#453)
* Added uniq.js, need to add tests

* Added basic tests for uniq.js

* Implemented uniq and added tests

* Generated docs for uniq

* Fixed lint error

* Added suport for -c and -d to uniq

* Generated docs

* Fixed formatting errors. Uniq now correctly returns empty string when output is specified

* Added uniq to piped methods

* Improved comment legibility

* Cleaned up the pipeline

* Added pipe test for uniq

* Converted uniq pipe test file to use linux line endings

* Fixed linting errors
2016-07-22 15:49:09 -07:00
Nate Fischer
3951a87913 refactor: commands now register themselves (#475) 2016-07-21 17:37:11 -07:00
Nate Fischer
5339375db0 fix(cp): -n option no longer raises error (#466)
Fixes #465
2016-06-28 00:27:33 -07:00
Nate Fischer
5d6adbaf53 fix(mv): works across partitions (#461)
Fixes #1
2016-06-19 14:44:32 -07:00
Nate Fischer
06c3d44e5b refactor: expose pipe-ability to command configuration (#464) 2016-06-17 16:05:59 -07:00
Nate Fischer
2e87f14c07 chore: update jshint and move it to an npm script (#454) 2016-06-07 16:57:42 -07:00
Nate Fischer
497149cc23 docs(exec): explicitly mention the shell option (#449) 2016-05-27 08:31:40 -07:00
Nate Fischer
57a9be2693 docs: comment code better to help contributors 2016-05-12 07:40:18 -07:00
Nate Fischer
2fa739e3f1 fix: null is no longer confused for an object
This is an issue in the case of `echo(which('fakecmd'))`. This used to succeed
in v0.6 but was broken during the ShellString refactor.
2016-04-20 15:20:05 -07:00
Nate Fischer
7f802ed20c fix(ls): no trailing newline for empty directories (#425) 2016-04-14 16:27:59 -07:00
Nate Fischer
56fbf5c414 feat(cp): -P option, plus better handling of symlinks (#421) 2016-04-08 15:34:54 -07:00
Nate Fischer
943a581b34 docs(error): deprecate relying on string value 2016-04-06 10:16:52 -04:00
Nate Fischer
b162a2ffe6 Merge pull request #419 from shelljs/docs-exec-return-value
docs(exec): fix docs about exec return type
2016-04-05 21:23:19 -07:00
Nate Fischer
e87e29dd8d fix: error message now printed for fatal failures 2016-03-31 22:11:44 -07:00
Nate Fischer
60d63015cd feat(command): new command: tail() 2016-03-31 21:05:30 -07:00
Nate Fischer
a1d5f6afb6 feat(command): new command: head() 2016-03-31 21:05:30 -07:00
Nate Fischer
f6952cb781 feat(command): new command: sort() 2016-03-31 21:05:30 -07:00
Nate Fischer
defd8d4215 refactor(rm): Remove duplicate code 2016-03-27 22:23:07 -07:00
Charles Verge
61cb383859 issue-407: Add regular files unit tests and fix symlink copy behavior 2016-03-24 22:32:55 -03:00
Nate Fischer
a41950770f feat(glob): expose config.globOptions.
Allow users to customize the settings of `glob.sync()` (if they so-desire). This
doesn't change the default behavior.
2016-03-24 18:06:26 -07:00