-
Notifications
You must be signed in to change notification settings - Fork 436
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
Return commandline when project dir is same #678
Conversation
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.
Hello @rjwebdev
Thanks for looking into this.
The line you changed was something I added to make the path relative to the project dir so that I could run GrumPHP both locally and in vagrant. So I am curious why it fails on your setup.
Can you give me some additional information about your setup?
- Are you running every command in your vagrant box?
- Where is GrumPHP located? (looks like it is globally installed because you mention /home/.composer
- Are you also committing to git inside the vagrant box?
- Can you provide me the guessed directories when running grumphp in verbose mode? (They are logged on top)
Maybe it makes more sense to try to shorten the command at another level instead.
$process->getCommandLine() | ||
); | ||
if (0 === | ||
strpos($process->getCommandLine(), $this->filesystem->ensureUnixPath($this->paths->getProjectDir()))) { |
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.
Won't this always skip the block?
The getCommandLine()
escapes the parameters with ' or ". so the project dir won't ever be the first char?
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.
I'm not really sure what you mean by the getCommandLine() escapes the parameters with ' or "
.
Also i'm not sure what $process->getCommandLine()
is supposed to return. I assumed it always was an absolute path, since the process of this function is making it relative.
That being said, the only valid way to make it relative, is when the project dir shares the same absolute path.
another quick edit: ignore what I said here before. Making it relative without checking checking the absolute path of the project dir, would create problems for our setup anyway.
Hi @veewee, I'll try to answer your questions, without having the project at hand.
So why does it fail: inside our box, our user and project directory have the same name. So when you replace the project dir |
Thanks for your feedback. It makes sense. |
Hi @veewee, It does not fix our issue:
|
Looks like you are pulling the wrong branch. It is developed at 'dev-improved-git-init-params' |
Ah oops, yeah, that branch fixed it:
|
Ok, thanks for testing! |
@veewee allright. It is possible to push a quick release with that fix? |
Hopefully somewhere next week. Stay tuned! :) |
@rvanginneken : it is released as 0.16.1 |
With this PR, the problem I reported in issue #671 is fixed. Our project dir in the vagrant box is
/vagrant
and after running the commandgrumphp git:init
, the generated git hooks contains the path withoutvagrant
so I became something like/home./.composer/...
. Now. the path in the git hooks is correctly generated.Also credits to @rvanginneken for searching for a solution