-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add configuration for gulp/gulpfile location #84
Comments
I think I have this issue. I am executing pre-commit from foo essentially and am getting an empty array for the changed files when I know they are there.
This results in Executing the pre-commit task directly does return the changed files though. It also works if I move the gulpfile to the root of the project, but I don't want to do that. Do you have a workaround? |
…ands from there Closes therealklanni#84 and therealklanni#41
I submitted a pull request/s. Sorry for the multiple commits. I'm still trying to get the hang of this and realized some issues I had to fix. I tried to follow the guidelines in CONTRIBUTING.md--hope I did that right. |
Actually, looking at it now, I see there are significant problems with what I'm doing. I just quickly hacked something and it seemed to work in one limited case, but I didn't really test it out enough. If you've got any ideas, let me know. |
Okay, maybe now? |
Grr. . . nevermind. |
Thanks for your efforts. Keep at it, I'm sure you'll get it! 👍 |
After struggling with git-guppy for a bit I realized that this issue is why I can't get it working. We have a large & complex codebase with multiple projects, each one has its own gulpfile that does linting and runs unit tests
I'd love to use this project, but until I have the ability to define the location of the gulpfile(s) I can't. |
@robfentress any luck finding a solution? :) |
Sorry. Been on vacation. For the moment, I've decided to just work around it in the gulpfiles themselves using the lodash, find-parent-dir, and path modules. That looks something like this:
I had to edit what I actually had in my code a bit to make it clearer for this example. Hopefully, I didn't introduce any typos. Either way, this is the principle I used. Please let me know if I've overlooked anything. |
It seems to me since git will tell you where it's operating from, as well as where you need to "cd" to, to find the root... it could be as simple as this... #114 |
I don't know if it's the case for you as well, but I am running gulp (ie. E.g.:
var dir = execSync('npm bin gulp').toString().trim(); to var dir = execSync(`cd ${cwd}; npm bin gulp`).toString().trim(); This should not affect projects which run gulp from the root, because cwd will be root. |
There seems to be an increasing need for complex project structures where gulp and/or gulpfile.js are not in the project root.
Example use case:
The goal would be to add a
guppy
entry inpackage.json
with a property that sets an override for thegulpfile.js
location or override the project path in such a way that guppy executes in the correct directory for gulp.Suggestions for better/best approaches for this are welcomed.
The text was updated successfully, but these errors were encountered: