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

feat(composer): add check for bin-dir #17

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

minorOffense
Copy link

Alright I'm going to preface this with this is the first time I've ever written Go code so hopefully it's not too terrible.

But this adds a method into the launcher to check composer for the bin-dir flag in the composer file. Otherwise it'll fallback to vendor/bin

@dasginganinja
Copy link
Owner

I'm interested in bringing this one in. I think this aligns with what we're trying to do here.

Let me finish up on the --root= code we have in progress since we've already removed the flag module. Once that is done I think this should merge in nicely.

Would you be able to write some tests for this version? I might need to pitch in here, too. 😆

@minorOffense
Copy link
Author

I could take a shot at it. Looks like i'm going to need a composer.json to store in here. Suppose I should just grab the one from the core-recommended

@dasginganinja
Copy link
Owner

We also need to make sure that situations where folks sanitize their composer.json works as well.

@minorOffense
Copy link
Author

Sorry what do you mean by sanitize the composer.json files? Like they remove them? Or do you mean they remove values from the json structure.

@dasginganinja
Copy link
Owner

@minorOffense What I mean is some people may remove files like composer.json from production. I can tell you that I remove things like install.php, .git/ and other stuff when we push to production in as part of our internal CI process.

I'd just like to make sure this works when there is no composer.json :) That's what the tests seemed to be complaining about, at least from what I saw.

@minorOffense
Copy link
Author

I think I fixed it... I can't run the tests locally. But I updated the main.go to fallback to vendor/bin if the composer finder doesn't find anything.

When a root is passed, we need to check the parent in case web dir is not the same a composer dir
When a root is passed, we need to check the parent in case web dir is not the same a composer dir
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.

2 participants