1
0
Fork 0

Replace backslashes in Window directories for config --list

pull/1586/head
johnstevenson 2013-02-14 23:12:24 +00:00
parent 625e174f76
commit a2525c8fbe
1 changed files with 2 additions and 1 deletions

View File

@ -40,7 +40,7 @@ class Factory
$cacheDir = getenv('COMPOSER_CACHE_DIR'); $cacheDir = getenv('COMPOSER_CACHE_DIR');
if (!$home) { if (!$home) {
if (defined('PHP_WINDOWS_VERSION_MAJOR')) { if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
$home = getenv('APPDATA') . '/Composer'; $home = str_replace('\\', '/', getenv('APPDATA')) . '/Composer';
} else { } else {
$home = rtrim(getenv('HOME'), '/') . '/.composer'; $home = rtrim(getenv('HOME'), '/') . '/.composer';
} }
@ -52,6 +52,7 @@ class Factory
} else { } else {
$cacheDir = getenv('APPDATA') . '/Composer/cache'; $cacheDir = getenv('APPDATA') . '/Composer/cache';
} }
$cacheDir = str_replace('\\', '/', $cacheDir);
} else { } else {
$cacheDir = $home.'/cache'; $cacheDir = $home.'/cache';
} }