Skip to content

Commit

Permalink
Use different conditional conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson committed Sep 10, 2018
1 parent bc0e399 commit e670ee2
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Commands/Remote/SSHBaseCommand.php
Expand Up @@ -110,11 +110,10 @@ protected function useTty($input)
*/
protected function validateEnvironment($site, $environment)
{
// Skip the warning for 'test' and 'live'
if (in_array($environment->id, ['test', 'live'])) {
return;
// Only warn in dev / multidev
if ($environment->isDevelopment()) {
$this->validateConnectionMode($environment->get('connection_mode'));
}
$this->validateConnectionMode($environment->get('connection_mode'));
}

/**
Expand All @@ -124,11 +123,7 @@ protected function validateEnvironment($site, $environment)
*/
protected function validateConnectionMode($mode)
{
// Skip the warning if it is disabled
if ($this->getConfig()->get('hide_git_mode_warning')) {
return;
}
if ($mode == 'git') {
if ((!$this->getConfig()->get('hide_git_mode_warning')) && ($mode == 'git')) {
$this->log()->warning(
'This environment is in read-only Git mode. If you want to make changes to the codebase of this site '
. '(e.g. updating modules or plugins), you will need to toggle into read/write SFTP mode first.'
Expand Down

0 comments on commit e670ee2

Please sign in to comment.