Brandon Freitag

Results 20 comments of Brandon Freitag

Hi @tejashah88, can you provide a small example of some code that has this issue? Thanks.

@nfischer I've added tests for `rm -r slash/`, `rm -rf slash/` `rm -r noslash`, and `rm -rf noslash`. I also found that the behavior of `rm('-r', 'slash/')` was incorrect, so...

My bad, I forgot to add `skipOnWin` to the new tests.

@bruce-one is there documentation on setting the offset to `-1`? I'm not seeing any references to that in the Node.js documentation or source code.

So, the issue with creating a class that inherits from `String` is that none of the methods on `String` are generic, so it really isn't possible without major hacking: ```js...

Btw, to define methods on a class: ```js class ShellString extends String { constructor() { ... } foo() { return 'hi'; } } ```

Idea: use an array instead of an object: ```js shell.grep('foo', 'file.txt', ['>', 'other.txt']); // redirect to other.txt shell.rm('missing-file.txt', ['2>', 'error.log']); // redirect stderr shell.cat('first.txt', ['>>', 'second.txt']); shell.cp('-r', 'src', 'out', ['2>&1']);...

In fact, arrays make sense here for another reason: redirects are ordered. Consider this: ```sh $ echo foo 2>&1 1>foo.txt ``` which has a different meaning than this: ```sh $...

For redirects, at least, bash will only treat the destination as a file descriptor address if there are no spaces in the redirect: ```sh $ echo foo 1>&2 # redirects...

I agree that `t.context.tmp` should contain the full path of the temporary directory, not the relative. But, the setup and teardown functions should take care of setting all of this...