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

Possibilities to give the command "patches-repatch" options for the composer install #564

Open
4 tasks done
saschabaecher-twocream opened this issue Mar 27, 2024 · 4 comments · May be fixed by #568
Open
4 tasks done
Labels
enhancement New features, options, or other additions.

Comments

@saschabaecher-twocream
Copy link

saschabaecher-twocream commented Mar 27, 2024

Verification

  • I have updated Composer to the most recent stable release (composer self-update)
  • I have updated Composer Patches to the most recent stable release (composer update cweagans/composer-patches)
  • I am using one of the supported PHP versions (8.0+)
  • I have searched existing issues and discussions for my idea.

Is your feature request related to a problem?

Currently you have to use the command patches-repatch to execute the patches, which then executes the normal Composer install routine.

But now you have the problem that you can not use options like --no-dev.

Describe your proposed solution(s)

The possibility to pass the command patches-repatch a new parameter "install-options" with a string in the following format: "--no-dev --no-interactions"

From this you can then store the options in the ArrayInput with the value true with an explode to " ".

Describe alternatives

No response

Additional context

No response

@saschabaecher-twocream saschabaecher-twocream added the enhancement New features, options, or other additions. label Mar 27, 2024
Copy link

👋 Thanks for the idea! Please remember that this is an open source project - feature requests may or may not be implemented, and if they are, the timeline is unknown. If you need a guaranteed implementation or timeline, sponsorships are welcome!

@cweagans
Copy link
Owner

Seems reasonable! It'll be a bit until I can work on this, but if you open a PR in the mean time, I'd be glad to review!

@saschabaecher-twocream
Copy link
Author

Hi @cweagans, with pleasure! PR is created.

@mfrieling
Copy link

I was looking if an issue for this problem already exists or not and am lucky to see a PR already. I hope this gets released soon.

Another way to think about this would be a --pre-install option. In my projects I usually use two custom composer scripts which look like this:

"scripts": {
  "deploy-staging": [
    "git pull -p",
    "@composer validate",
    "@composer install --optimize-autoloader"
  ],
  "deploy": [
    "git pull -p",
    "@composer validate",
    "@composer install --no-dev --optimize-autoloader"
  ]
}

With the --pre-install option this would be possible:

"scripts": {
  "pre-install-cmd": [
    "@composer patches-repatch --pre-install"
  ],
  "deploy-staging": [
    "git pull -p",
    "@composer validate",
    "@composer install --optimize-autoloader"
  ],
  "deploy": [
    "git pull -p",
    "@composer validate",
    "@composer install --no-dev --optimize-autoloader"
  ]
}

This way patches-repatch would do its job as part of the composer install pre-hooks without executing the composer install by itself. Currently this is not possible because that would lead to an endless loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, options, or other additions.
Projects
None yet
3 participants