Skip to content

Conversation

@barrysteyn
Copy link

Hi Keith

Inspired by your blog post about scrapping grunt etc, and just using NPM, I happily using parallelshell. Unfortunately, there are many cases where I need to set the current working directory (CWD) to run the command in. Now that we are using exec, cd does not work. So I have come up with my own solution, which is to pass parallelshell a JSON array, and if it parses and if it contains two items, the first item will be the CWD. If any of those conditions do not hold, then just use as per normal.

@keithamus
Copy link
Collaborator

@barrysteyn could you try checking out #30 and seeing if that works without your changes. #30 is the direction we want to be going in.

@barrysteyn
Copy link
Author

Hi @keithamus. From just looking at #30, I think it should be able to do what I need. But I am still of the opinion that one should be able to set the CWD. The way I have done it is a little inelegant for the user. I have not tested #30, but I still advise that there should be some way to set the CWD.

@keithamus
Copy link
Collaborator

I don't think it's necessary to set the cwd provided we're spawning shells. I'll agree that the current implementation is broken, but if we merge #30 then you can just do one of the following:

cd /some/folder && parallelshell 'some command'
parallelshell 'cd /some/folder && some command'

@Jokero
Copy link

Jokero commented Sep 2, 2017

@keithamus When do you plan to merge #30 ? I also need this feature)

@darkguy2008
Copy link
Owner

@Jokero I can give it a try and see if it works correctly, then I'll merge :)

@Jokero
Copy link

Jokero commented Sep 2, 2017

Cool, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants