mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-05 00:48:57 +02:00
Added identity file option for ssh and scp commands
This commit is contained in:
+23
-13
@@ -341,10 +341,20 @@ class Config
|
||||
public function getHostPort()
|
||||
{
|
||||
$info = explode(':', $this->host);
|
||||
$info[] = $this->deployment('port', '22');
|
||||
$info[] = $this->deployment('port', '22');
|
||||
return $info[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the general Host Identity File Option
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHostIdentityFileOption()
|
||||
{
|
||||
return $this->deployment('identity-file') ? '-i '.$this->deployment('identity-file').' ': '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current Host
|
||||
*
|
||||
@@ -405,7 +415,7 @@ class Config
|
||||
}
|
||||
|
||||
// Global Config
|
||||
$config = $this->getEnvironmentOption('deployment', array());
|
||||
$config = $this->getEnvironmentOption('deployment', array());
|
||||
if (isset($config[$option])) {
|
||||
if (is_array($default) && ($config[$option] == '')) {
|
||||
return $default;
|
||||
@@ -424,7 +434,7 @@ class Config
|
||||
* @param string $default
|
||||
* @return mixed
|
||||
*/
|
||||
public function release($option, $default = false)
|
||||
public function release($option, $default = false)
|
||||
{
|
||||
// Host Config
|
||||
if (is_array($this->hostConfig) && isset($this->hostConfig['releases'])) {
|
||||
@@ -432,17 +442,17 @@ class Config
|
||||
return $this->hostConfig['releases'][$option];
|
||||
}
|
||||
}
|
||||
|
||||
$config = $this->getEnvironmentOption('releases', array());
|
||||
|
||||
$config = $this->getEnvironmentOption('releases', array());
|
||||
if (isset($config[$option])) {
|
||||
if (is_array($default) && ($config[$option] == '')) {
|
||||
return $default;
|
||||
} else {
|
||||
return $config[$option];
|
||||
}
|
||||
} else {
|
||||
return $default;
|
||||
}
|
||||
if (is_array($default) && ($config[$option] == '')) {
|
||||
return $default;
|
||||
} else {
|
||||
return $config[$option];
|
||||
}
|
||||
} else {
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user