Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 54fddbe

Browse files
geerlingguygrasmash
authored andcommitted
Fixes #1355: Make Drush alias for 'local' work in VM guest or host by default. (#1356)
* Fixes #1355: Make Drush alias for 'local' work in VM guest or host by default. * Issue #1355: Clean up comments in Drupal VM aliases file.
1 parent 457a220 commit 54fddbe

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
// [vagrant_machine_name].local
1+
// Local environment.
22
$aliases['${project.machine_name}.local'] = array(
3-
// /var/www/[vagrant_machine_name]/docroot
43
'root' => '/var/www/${project.machine_name}/docroot',
5-
// vagrant_hostname
64
'uri' => '${project.local.uri}',
7-
// vagrant_hostname
8-
'remote-host' => '${project.local.hostname}',
9-
'remote-user' => 'vagrant',
10-
'ssh-options' => '-o PasswordAuthentication=no -i ' . drush_server_home() . '/.vagrant.d/insecure_private_key'
11-
);
5+
);
6+
// Add remote connection options when alias is used outside VM.
7+
if ('vagrant' != $_SERVER['USER']) {
8+
$aliases['${project.machine_name}.local'] += array(
9+
'remote-host' => '${project.local.hostname}',
10+
'remote-user' => 'vagrant',
11+
'ssh-options' => '-o PasswordAuthentication=no -i ' . drush_server_home() . '/.vagrant.d/insecure_private_key'
12+
);
13+
}

0 commit comments

Comments
 (0)