Skip to content
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

Allow a working directory to be specified #191

Open
shadowhand opened this issue Dec 22, 2022 · 2 comments
Open

Allow a working directory to be specified #191

shadowhand opened this issue Dec 22, 2022 · 2 comments

Comments

@shadowhand
Copy link

shadowhand commented Dec 22, 2022

We are adding some additional (micro) services to our project, so now we have:

composer.json
composer.lock
services/
  foo/
    package.json
    package-lock.json

I'd like to be able to check for changes to services/foo/package{-lock,}.json and execute npm install but within the services/foo directory.

Is there any way that I can tell CaptainHook to execute the action in a different directory? I'm looking for something like:

{
  "action": "npm install",
  "options": {
    "in-directory": "services/foo"
  },
  "conditions": [ ]
}
@sebastianfeldmann
Copy link
Collaborator

sebastianfeldmann commented Dec 22, 2022

You could do something like

"action": "cd services/foo && npm install && cd ../.."

That should work

@shadowhand
Copy link
Author

That seems to work. I think it would still be really useful to have some kind of "working directory" option that would cause both the conditions and the action to operate somewhere other than the root directory.

@sebastianfeldmann sebastianfeldmann added this to the Hacktoberfest23 milestone Sep 26, 2023
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

No branches or pull requests

2 participants