128 Commits

Author SHA1 Message Date
Ari Porad
d0b7d0943f Merge pull request #360 from shelljs/refactor-shellstring
refactor(ShellString): refactor shellstring
2016-02-20 14:51:19 -08:00
Nate Fischer
2978855a53 Add ShellString-like methods for ls()'s result 2016-02-19 20:43:39 -08:00
Nate Fischer
14d518c3c4 Merge pull request #365 from shelljs/properly-escape-tempdir
fix(exec): properly handles paths with spaces and quotes
2016-02-19 15:02:51 -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
Nate Fischer
951376b300 fix(exec): properly handles paths with spaces and quotes 2016-02-18 18:22:38 -08:00
Nate Fischer
0166658597 fix(verbose): verbose-style logging is consistent 2016-02-16 21:11:31 -08:00
Nate Fischer
0da963b51f Merge pull request #357 from jcoreio/master
config.fatal now throws an exception
2016-02-16 14:44:29 -08:00
Ari Porad
bceac928c4 Merge pull request #346 from shelljs/touch-multiple-files
feat(touch): supports multiple files
2016-02-16 12:27:06 -07:00
Ari Porad
63e4acc779 Merge pull request #359 from shelljs/feat-use-glob
feat(glob): use glob module for globbing
2016-02-16 11:50:15 -07:00
Nate Fischer
19721fc28e feat(touch): supports multiple files 2016-02-16 09:59:25 -08:00
Nate Fischer
e2f980e29d feat(set): add -f option to disable shell globbing 2016-02-16 09:48:24 -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
Nate Fischer
04f891f785 feat(glob): use glob module for globbing
Switch to the glob module to do shell globbing. Fixes a bug in `cp()` where
hidden files were not copied recursively.
2016-02-16 03:11:04 -08:00
Ari Porad
3ebfe1a070 Merge pull request #352 from shelljs/glob-all-commands
feat(glob): glob support for (almost) all commands
2016-02-14 11:44:46 -08: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
3a7eb3f2ad feat(glob): glob support for (almost) all commands 2016-02-13 21:22:48 -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
3ea5e247ee feat(grep): add -l option
`grep -l` will only print filenames of matching files.
2016-02-09 09:23:17 -08:00
Nate Fischer
bc13470f91 Update examples in docs for cp() 2016-02-05 13:48:28 -08:00
Nate Fischer
dc79d7eff0 fix(touch): enhance parseOptions and fix touch's -r flag 2016-02-04 15:41:48 -08:00
Ari Porad
c0d9cf7ba1 Merge pull request #335 from shelljs/more-exec-options
feat(exec): allow all exec options to pass through
2016-02-04 14:56:25 -08:00
Nate Fischer
164a214e5a use common.extend 2016-02-04 12:17:01 -08:00
Nate Fischer
8377b927bf fix(cp): add -n option, make -f default behavior 2016-02-03 21:13: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
f729896516 Merge pull request #329 from shelljs/feat-set-command
feat(set): add new set() command
2016-01-31 20:26:39 -08:00
Ari Porad
ee5baf7344 Merge pull request #326 from shelljs/fix-cat-semantics
fix(cat): make behavior more like unix
2016-01-31 20:25:26 -08:00
Nate Fischer
ca045ea4c5 feat(set): add new set() command
Add new set() command as a wrapper for `config` variables. This takes the `-e`,
`-v`, `+e`, and `+v` flags.
2016-01-31 20:17:37 -08:00
Nate Fischer
2d1ee4dae4 fix(mv): add -n option, make -f default behavior 2016-01-31 15:34:01 -08:00
Nate Fischer
d8466a14dd Merge pull request #324 from shelljs/ls-l-option
feat(ls): add -l  option
2016-01-31 11:18:09 -08:00
Nate Fischer
e918c758a2 feat(ls): add -l option
The `-l` option will now cause `ls()` to return an object containing file stats.
These objects will also have a toString() method that formats it into something
analogous to `ls -l`'s output format.
2016-01-31 11:08:03 -08:00
Ari Porad
a96467a6f5 Merge pull request #290 from isiahmeadows/pathext
feat(Windows): search PATHEXT instead of 3 hardcoded values
2016-01-31 09:01:16 -08:00
Burak Yigit Kaya
fb5a7ece66 Fix symlinking on Windows
Fixes symlink creation on Windows systems and adds a test
for symlinking directories since it needs special treatment
on Windows.

Fixes #301.
2016-01-31 13:15:22 +02:00
Nate Fischer
580d6d3301 fix(cat): make behavior more like unix
`cat()` no longer puts '\n's in weird places (causing double newlines), and
no longer improperly strips off a trailing newline.
2016-01-31 00:07:53 -08:00
Isiah Meadows
eaa771033e Search PATHEXT for which, do a lowercase comparison on Windows
Redo of #134

`which` now searches through PATHEXT on Windows, and it also now does a
case-insensitive comparison. This better fits the Windows environment, where
the OS usually ignores case.
2016-01-29 13:34:20 -05:00
Nate Fischer
bccf620787 feat(sed): support multiple file names
fixes #231. Semantics are like unix sed.
2016-01-27 19:08:33 -08:00
Burak Yigit Kaya
175f5e1efd Fix tests on Windows 2016-01-27 22:53:31 +02:00
Ari Porad
90a98a51e8 Merge pull request #311 from nfischer/ls-d-option
feat(ls): add -d flag to ls()
2016-01-26 18:51:12 -08:00
Nate Fischer
c6da9e76fd feat(ls): add -d flag to ls() 2016-01-25 23:44:20 -08:00
Brandon Freitag
39ab73ff61 Check that source exists for hard links 2016-01-25 01:48:06 -08:00
Brandon Freitag
fd27d85317 Use OS-agnostic filepath verification 2016-01-24 22:35:45 -08:00
Brandon Freitag
bceb066c5c Fix relative symlinks, add tests
When creating a symlink with a relative path, e.g. `ln('-s', '../baz.txt', 'foo/bar/link')`,
the link will be created releative to the destination directory, not to the
current working directory of the node process. Also added tests for
functionality.
2016-01-24 22:35:45 -08:00
Timothy Gu
18df9540ab Make to and toEnd chainable 2016-01-24 15:03:20 -08:00
Ari Porad
154d6a626a Merge pull request #303 from nfischer/more-regex-tests
fix: regexes are more consistent with sed and grep
2016-01-24 14:16:17 -08:00
Nate Fischer
dfaa78abef feat(cd): cd() (no args) changes to home directory 2016-01-24 13:19:57 -08:00
Ari Porad
c4220691b7 Merge pull request #293 from nfischer/feat-home-directory-tilde
feat: add tilde expansion to expand()
2016-01-24 11:50:40 -08:00
Nate Fischer
b3f266469b feat: add tilde expansion to expand()
This adds tilde expansion to the expand() function. Arguments starting with '~/'
will have the tilde expanded to the user's home directory, as with Bash.
2016-01-23 21:52:20 -08:00
Nate Fischer
1979d07776 Adding previousDir field to common.state to allow cd('-') to work like Bash 2016-01-23 21:24:13 -08:00
Nate Fischer
1ee696d824 fix: regexes are more consistent with sed and grep
sed will now convert search strings to regex form, so `'a*'` will now work like
`/a*/`. Also, new tests for grep and sed ensure that '*' is not expanded for
filename globbing.
2016-01-23 21:16:43 -08:00
Nate Fischer
5ea67cf06d Fix ls docs 2016-01-23 17:32:26 -08:00