drush_log(dt("Copied example Drush configuration file to !path", array('!path' => $drush_config_file)), LogLevel::OK);
}
+ // If Drush is not in the $PATH, then figure out which
+ // path to add so that Drush can be found globally.
+ $add_path = drush_get_option('add-path', NULL);
+ if ((!drush_which("drush") || $add_path) && ($add_path !== FALSE)) {
+ $drush_path = drush_find_path_to_drush($home);
+ $drush_path = preg_replace("%^" . preg_quote($home) . "/%", '$HOME/', $drush_path);
+
+ $bashrc_additions["%$drush_path%"] = "\n# Path to Drush, added by 'drush init'.\nexport PATH=\"\$PATH:$drush_path\"\n\n";
+ }
+
// If there is no ~/.drush/drush.bashrc file, then copy
// the example bashrc file there
if (!is_file($drush_bashrc)) {
// ~/.bashrc or ~/.bash_profile
$bashrc = drush_init_find_bashrc($home);
- // If Drush is not in the $PATH, then figure out which
- // path to add so that Drush can be found globally.
- $add_path = drush_get_option('add-path', NULL);
- if ((!drush_which("drush") || $add_path) && ($add_path !== FALSE)) {
- $drush_path = drush_find_path_to_drush($home);
- $drush_path = preg_replace("%^" . preg_quote($home) . "/%", '$HOME/', $drush_path);
-
- $bashrc_additions["%$drush_path%"] = "\n# Path to Drush, added by 'drush init'.\nexport PATH=\"\$PATH:$drush_path\"\n\n";
- }
-
// Modify the user's bashrc file, adding our customizations.
$bashrc_contents = "";
if (file_exists($bashrc)) {