-
Notifications
You must be signed in to change notification settings - Fork 744
Add new CLI script for running commands #244
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
Conversation
|
How about |
|
Yeah, you're right. My goal was to make it work without too much typing for providing a good alternative to bash commands in npm "inline" scripts where you often chain multiple commands together. |
|
I actually don't really have any preference on any approach. I think the Thanks @nickdima for working on this. Really looking forward to this! |
|
@nfischer: Thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once #269 is merged, let's use the error code it returns
|
@nickdima thanks! This looks great, and I'm sure a lot of people would appreciate this.
@ariporad what are your thoughts on |
|
@tobiastom said:
Valid concern, but if we are to stick with the semantics of |
|
Wow, I did this 4 months ago so I had to get back into context :) |
|
I like -c. It makes the most sense to me. |
|
@nickdima would you be able to refactor this into the |
|
I suppose the only concern is if users get confused by whether to write: $ shjs -c rm -rf fooor |
|
Well, the second would be correct. I guess just throw an error for the |
|
@ariporad the way this is written, the first would be correct actually. The second is not supported (hence why I think it's slightly confusing). |
|
@nfischer: Hmm... That actually makes me less sure if we should do this. Now that I think about it, I'm not sure if we should be encouraging embedding shell scripts as js inside package.json. And the way it's implemented now is very confusing. (Its just an incomplete, non-compliant implementation of bash). So I'm not sure about this, maybe modules like 'mkdirp' or 'rimraf' are just the way to go. |
|
@nfischer: Hmm... |
|
@ariporad I'm ok with making it its own module. |
|
jsh is already used by other projects too: https://code.google.com/archive/p/jsh/ (which is also a "JavaScript SHell." How about |
|
or just |
|
@ariporad I'm ok with you repackaging it as a new module, maybe it's better that way |
|
@ndelitski: Ok, Thanks! Anyone have any naming ideas? ( |
|
I vote against |
|
Ok everyone, I have a bad idea: What about Actually, that gives me a better idea: What about |
|
I actually like |
|
Sounds great to me, @nfischer? |
|
I prefer |
|
Ok, shx it is. I'll implement tomorrow, first thing in the AM. Ari On Sun, Jan 31, 2016 at 8:56 PM, Nate Fischer [email protected]
|
|
SGTM |
|
It looks like this is blocked by #269. |
|
@ariporad you can set up the repo now and get the basic utility built. Then error codes can be added soon after |
|
Ok everyone, initial implementation in shelljs/shx. Feedback welcome! |
|
If people are satisfied with the extra repo, we can probably close this issue. Thoughts? |
|
Seems to work really nice for me. Thank you very much for implementing this. One little side discovery: will the |
|
@tobiastom: We don't have a |
|
Also, closing this. |
|
For people who see this in the future, this has been moved to shelljs/shx#1. Please continue discussion there. (And I'm going to lock this thread). |
|
@ariporad the |
I've added a new CLI script called
shlfor running one-off commands as discussed in #202.This is more a proposal and we can polish it some more before merging as I have the impression that a second CLI script will add some confusion.
To use the script you simple pass the command name as the first argument and any subsequent arguments will be passed to the command itself. Eg.:
shl rm -rf some_dirWe also need to figure out the best way to print the output of commands like
lswhich in this case returns an array.