Skip to content

Commit

Permalink
Save patches in the root directory, not web/.
Browse files Browse the repository at this point in the history
- This makes it easier to use CLI completion for 'lando patch --revert'.
- This makes it harder to include the patch file when generating a new
  patch.
  • Loading branch information
benjifisher committed Jul 4, 2020
1 parent 79d265d commit 418cc9b
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions scripts/patch-helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
$urlParts = explode('/', $url);
$patchName = end($urlParts);
getPatch($url);
movePatch($patchName);
applyPatch($patchName);
}
}
Expand All @@ -33,19 +32,7 @@
*/
function getPatch($url) {
exec(
"wget $url"
);
}

/**
* Move the patch into drupal root.
*
* @param string $patchName
* The name of the patch.
*/
function movePatch($patchName) {
exec(
"mv $patchName web/"
"wget -P /app $url"
);
}

Expand All @@ -57,7 +44,7 @@ function movePatch($patchName) {
*/
function applyPatch($patchName) {
exec(
"git -C /app/web apply -v $patchName"
"git -C /app/web apply -v /app/$patchName"
);
}

Expand All @@ -69,7 +56,7 @@ function applyPatch($patchName) {
*/
function revertPatch($patchName) {
exec(
"git -C /app/web apply -Rv $patchName"
"git -C /app/web apply -Rv /app/$patchName"
);
}

Expand All @@ -81,6 +68,6 @@ function createPatch() {
$branch = explode('/', $output[0]);
$branch = end($branch);
exec(
"git -C /app/web diff 8.8.x > $branch.patch"
"git -C /app/web diff 8.8.x > /app/$branch.patch"
);
}

0 comments on commit 418cc9b

Please sign in to comment.