Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates-3245996
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
automatic_updates-3245996
Commits
2c622221
Commit
2c622221
authored
3 years ago
by
Adam G-H
Committed by
Adam G-H
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Restore a few things
parent
9af8839a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
automatic_updates.services.yml
+6
-6
6 additions, 6 deletions
automatic_updates.services.yml
src/Event/ExcludedPathsSubscriber.php
+6
-4
6 additions, 4 deletions
src/Event/ExcludedPathsSubscriber.php
with
12 additions
and
10 deletions
automatic_updates.services.yml
+
6
−
6
View file @
2c622221
...
...
@@ -24,6 +24,12 @@ services:
-
'
@update.manager'
tags
:
-
{
name
:
event_subscriber
}
automatic_updates.excluded_paths_subscriber
:
class
:
Drupal\automatic_updates\Event\ExcludedPathsSubscriber
arguments
:
-
'
@extension.list.module'
tags
:
-
{
name
:
event_subscriber
}
automatic_updates.staged_projects_validator
:
class
:
Drupal\automatic_updates\Validator\StagedProjectsValidator
arguments
:
...
...
@@ -64,9 +70,3 @@ services:
class
:
Drupal\automatic_updates\Validator\CoreComposerValidator
tags
:
-
{
name
:
event_subscriber
}
automatic_updates.excluded_paths_subscriber
:
class
:
Drupal\automatic_updates\Event\ExcludedPathsSubscriber
arguments
:
-
'
@extension.list.module'
tags
:
-
{
name
:
event_subscriber
}
This diff is collapsed.
Click to expand it.
src/Event/ExcludedPathsSubscriber.php
+
6
−
4
View file @
2c622221
...
...
@@ -2,12 +2,13 @@
namespace
Drupal\automatic_updates\Event
;
use
Drupal\automatic_updates
\Updater
;
use
Drupal\Core\Extension\ModuleExtensionList
;
use
Drupal\package_manager
\Event\PreCreateEvent
;
use
Symfony\Component\EventDispatcher\EventSubscriberInterface
;
/**
* Defines an event subscriber to exclude certain paths from
staging area
s.
* Defines an event subscriber to exclude certain paths from
update operation
s.
*/
class
ExcludedPathsSubscriber
implements
EventSubscriberInterface
{
...
...
@@ -29,14 +30,15 @@ class ExcludedPathsSubscriber implements EventSubscriberInterface {
}
/**
*
Excludes paths from a staging area before it is created
.
*
Reacts to the beginning of an update process
.
*
* @param \Drupal\package_manager\Event\PreCreateEvent $event
* The event object.
*/
public
function
preCreate
(
PreCreateEvent
$event
):
void
{
// If this module is a git clone, exclude it.
if
(
is_dir
(
__DIR__
.
'/../../.git'
))
{
// If we are doing an automatic update and this module is a git clone,
// exclude it.
if
(
$event
->
getStage
()
instanceof
Updater
&&
is_dir
(
__DIR__
.
'/../../.git'
))
{
$dir
=
$this
->
moduleList
->
getPath
(
'automatic_updates'
);
$event
->
excludePath
(
$dir
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment