Skip to content

Commit

Permalink
Feature: added desktop notification to few ws commands
Browse files Browse the repository at this point in the history
  • Loading branch information
satrun77 committed Aug 25, 2017
1 parent 8776ced commit 72c2fa0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/MooCommand/Command/Workspace/Build.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ protected function fire()
// Display success message
$successMessage = 'The site build completed successfully.';
$this->getOutputStyle()->success($successMessage);
$this->notify('Build environment ' . $this->getConfigHelper()->getCurrentSiteName(), $successMessage);

// Ask to start container
if ($this->getQuestionHelper()->confirmAsk('Would you like to start the new container?', false)) {
Expand Down
3 changes: 3 additions & 0 deletions src/MooCommand/Command/Workspace/CloneProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ protected function fire()
// Fix files permission (ie. make executable)
$this->fixFilesPermissions($setup);

// Display desktop notification
$this->notify('Clone environment', 'Repository cloned, you like to start the new environment?');

// Ask to start container
if ($this->getQuestionHelper()->confirmAsk('Would you like to start the new environment?', false)) {
$this->getShellHelper()->execRealTime('./start');
Expand Down
1 change: 1 addition & 0 deletions src/MooCommand/Command/Workspace/Remove.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ protected function fire()
// Success message
$successMessage = 'The site removed successfully.';
$this->getOutputStyle()->success($successMessage);
$this->notify('Remove environment ' . $this->getConfigHelper()->getCurrentSiteName(), $successMessage);
}
}
3 changes: 3 additions & 0 deletions src/MooCommand/Command/Workspace/Stop.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ protected function stopAllContainers()
$stop = $this->getShellHelper()->exec('docker stop $(docker ps -a -q)');
if (!$stop->isSuccessful()) {
$this->getOutputStyle()->error('Unable to stop containers');
} else {
$this->notify('Stop all environment', 'All containers are stopped.');
}
}

Expand All @@ -87,5 +89,6 @@ protected function stopContainer()
// Success message
$successMessage = 'The site stopped successfully.';
$this->getOutputStyle()->success($successMessage);
$this->notify('Stop environment ' . $this->getConfigHelper()->getCurrentSiteName(), $successMessage);
}
}
1 change: 1 addition & 0 deletions src/MooCommand/Command/Workspace/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ protected function fire()
// Display success message
$successMessage = 'The container files updated successfully.';
$this->getOutputStyle()->success($successMessage);
$this->notify('Update environment ' . $this->getConfigHelper()->getCurrentSiteName(), $successMessage);

// Build the container
$this->getShellHelper()->execApplicationCommand('ws:build', [
Expand Down

0 comments on commit 72c2fa0

Please sign in to comment.