diff --git a/composer_manager.drush.inc b/composer_manager.drush.inc index 66dc5ee..f7f9b5f 100644 --- a/composer_manager.drush.inc +++ b/composer_manager.drush.inc @@ -76,10 +76,15 @@ function drush_composer_manager($command = 'install') { // Generate the command arguments to pass to Drush Composer. $drush_arguments = drush_get_arguments(); + + if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { + $dir = escapeshellcmd($dir); + } + if ($drush_arguments && $drush_arguments[0] === 'composer-manager') { $arguments = $drush_arguments; - array_shift($arguments); // exclude drush main command, composer-manager - $arguments[] = '--working-dir=' . escapeshellcmd($dir); + array_shift($arguments); // exclude drush main command, composer-manager + $arguments[] = '--working-dir=' . $dir; } else { $arguments = array( @@ -87,7 +92,7 @@ function drush_composer_manager($command = 'install') { // The use of escapeshellcmd rather than escapeshellarg is necessary to // avoid enclosing the value in quotes, which is incompatible with the way // Composer validates that the working directory exists. - '--working-dir=' . escapeshellcmd($dir), + '--working-dir=' . $dir, ); }