Git Product home page Git Product logo

Comments (3)

dafeder avatar dafeder commented on September 25, 2024

We're going to try doing this with patches in the drupal core makefile. But so far we've had trouble with local patches, so we're going to try to fix that as part of this as well...

from dkan-tools.

dafeder avatar dafeder commented on September 25, 2024

I've done this successfully with existing tools.

  1. First, make the changes you want to .htaccess, and use whatever your favorite process is to create a patch file. What I do is make the change (for this example I just added a single commented-out line, "TESTING .htaccess PATCH"), do git diff --relative .htaccess > htaccess-patch.patch, then revert the change (git checkout .htaccess).

My resulting file looks like this:

diff --git a/.htaccess b/.htaccess
index 37fce10..37b6fdb 100644
--- a/.htaccess
+++ b/.htaccess
@@ -152,3 +152,5 @@ DirectoryIndex index.php index.html index.htm
   # Disable content sniffing, since it's an attack vector.
   Header always set X-Content-Type-Options nosniff
 </IfModule>
+
+# TESTING .htaccess PATCH
\ No newline at end of file
  1. Place your patch file in /src/patches/ (the actual path doesn't really matter as long as it's outside /docroot)

  2. Add some lines like this to /src/make/drupal.make:

projects:
  drupal:
    patch:
      1: ../src/patches/htaccess-patch.patch
  1. Next time you run drupal:make (soon to be replaced by make:drupal or just make) the patch should apply. Note that the patch file will also be copied into the project directory (docroot in the case of Drupal, the module folder if you're applying a local patch to a module), which is just some drush make weirdness we can't avoid.

from dkan-tools.

fmizzell avatar fmizzell commented on September 25, 2024

@dafeder Awesome, this looks great to me, hopefully @janette can confirm that it works.

from dkan-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.