New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding export command #44
Conversation
Also, the contributing page is pretty nicely done 👍 |
Very nicely done! I don't see anything wrong with this. 👍
Oh good - I'm glad it helped. It's hard to keep a balance between to little and too much data that doesn't turn someone off. |
On a separate note, do we want to publish If so, just add it here: https://github.com/dthree/cash/blob/master/commands.json#L74 It's pretty simple. Just copy paste another and ensure you include all deps. |
Would it work as a separate module? Internally, it modifies I suppose it might be useful for |
Ah good point. I was thinking that, if called independently, it could |
I suspect that's not possible (at least on POSIX), since I think it's an operating system security feature. I don't know as much about Windows, however. |
Okay, let's scratch it. As the last point on that, we should add https://github.com/dthree/cash/blob/master/commands.json#L23 That prevents it from being added to PATH on |
I think it should be good (see https://github.com/dthree/cash/blob/master/commands.json#L26). Let me know if I should change something. |
Oh, silly me, you'd already added it! Perfect duplication of instructions, btw! Not a single thing wrong on that PR. |
Woohoo! 👍 |
This adds the
export
command (man page) into the mix.Similar to how
cash $ alias foo ls
succeeds (when it wouldn't succeed in bash),cash $ export FOO $PATH
also succeeds in redefiningFOO
to be$PATH
.This exports to
process.env
, which is case insensitive on Windows (even for the new attributes I'm adding). So, on Windows, you can do things like:I don't think there's any good way to avoid this behavior, so until it's a problem, I suggest it be kept.
This doesn't replace regular assignment. In bash, you can do non-exported assignment of the form:
foo=bar
, creating a variable named foo with the value "bar". I couldn't figure out a way to write the syntax for regular assignment (posted issue #42 for this).@dthree do you have any suggestions for additional tests? I modeled unit tests off the ones for
alias
.