REBELinBLUE\Deployer\Scripts\Runner::wrapCommand PHP Method

wrapCommand() private method

Wraps the command in either local or remote wrappers.
private wrapCommand ( string $script ) : string
$script string
return string
    private function wrapCommand($script)
    {
        $wrapper = 'Locally';
        $tokens = ['script' => trim($script)];
        if (!$this->is_local) {
            $wrapper = 'OverSSH';
            $tokens = array_merge($tokens, ['private_key' => $this->private_key, 'username' => $this->alternative_user ?: $this->server->user, 'port' => $this->server->port, 'ip_address' => $this->server->ip_address]);
        }
        $output = with(new Parser())->parseFile('RunScript' . $wrapper, $tokens);
        Log::debug($output);
        return $output;
    }