Skip to content

Commit

Permalink
Merge pull request #199 from lemberg/issue/198-settings-gets-deleted
Browse files Browse the repository at this point in the history
#198 Fix package settings gets deleted from the composer.lock
  • Loading branch information
T2L committed Jun 5, 2020
2 parents 4829db3 + c4e185a commit b099e86
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Draft Environment 3.x.x (Unreleased)

Fixes:

- [GH-198](https://github.com/lemberg/draft-environment/issues/198) - Fix package settings gets deleted from the composer.lock when running any arbitrary composer command

## Draft Environment 3.0.0, 2020-04-27

Updates:
Expand Down
15 changes: 8 additions & 7 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,19 @@ private function handleScriptEvent(ScriptEvent $event): void {
private function onPostAutoloadDumpCommand(ScriptEvent $event): void {
if ($this->shouldRunInstallation) {
$this->configInstallManager->install();

// Fresh installation should mark all available updates as already
// applied.
$lastAvailableWeight = $this->configUpdateManager->getLastAvailableUpdateWeight();
$this->configUpdateManager->setLastAppliedUpdateWeight($lastAvailableWeight);
$this->shouldRunInstallation = FALSE;
}
$this->shouldRunInstallation = FALSE;

if ($this->shouldRunUpdate) {
$this->configUpdateManager->update();
$this->shouldRunUpdate = FALSE;
}
$this->shouldRunUpdate = FALSE;

// Mark the package as already installed.
$this->configInstallManager->setAsAlreadyInstalled();
// Mark all available updates as already applied.
$lastAvailableWeight = $this->configUpdateManager->getLastAvailableUpdateWeight();
$this->configUpdateManager->setLastAppliedUpdateWeight($lastAvailableWeight);
}

}

0 comments on commit b099e86

Please sign in to comment.