-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
Install patches from local file #146
Comments
Yes, this is possible. Instead of a URL, you can specify a path to your patch file relative to the directory that your composer.json is in. For instance, if the patch file is in the same directory as your composer.json, the URL would be either 'patchname.patch' or './patchname.patch'. |
(For reference, the plugin just uses file_get_contents() under the hood, so anything you can pass as the first argument will be valid for this plugin) |
@cweagans Thank you for your reply. Is it possible that some folder permissions interfere with this process? I created a I tried debugging your module for a bit and found out it was breaking in the I eventually found another way to solve my problem, but if it's helpful I could open an issue with more details and the error messages. |
If you can post a composer.json that reproduces the problem here, I can take a look. |
Change your patch extension to
|
Adding .txt is what fixed it for me. Thanks @milkovsky ! |
This would have saved me a lot of time. This fix is referenced here cweagans/composer-patches#146
The |
@cweagans: Can this issue be reopened? The current version is not accepting local patches named |
Still works fine for me. Please ensure your path is setup correctly to reference from the project root for composer to find the file in question |
I don't get a file not found message. It just doesn't apply. FWIW, this is a Drupal core patch. I still haven't received an answer to my question about the |
To reproduce this, try creating a core patch and install it from a local file instead of a remote url. |
Can you paste your composer.json code into a comment here and we might be able to track down the issue? |
I figured out my issue. Apparently, a simple |
Fixing the path in the patch file worked for me. In my case, I was trying to patch a Drupal project. When I created the patch file, it used the path relative to where I was in the project. When applying patches, composer in a Drupal project uses a different path. As created:
Changes needed for composer to apply:
|
As per cweagans/composer-patches#146 , try renaming the patches to use a .txt suffix, to see if that works.
I created a
.patch
file for a Drupal module that I have been using, and I would like to have it versioned with my codebase, but not publicly online. That being said, I would like to have the file stored locally and use a similar syntax to what is already possible, but referring a local file instead of an URL. Is this possible?The text was updated successfully, but these errors were encountered: