Added fix for Ticket #1019.

bake.php on windows adding slash before filepath when creating unit test files

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3134 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-06-19 01:44:18 +00:00
parent 965874ccae
commit e7b26eed83

View file

@ -1350,20 +1350,25 @@ class Bake {
}
}
$path = implode(DS, $path);
$unixPath = DS;
if (strpos( PHP_OS, ÔWINÕ ) === 0){
$unixPath = null;
}
if (!is_dir(DS.$path)) {
if (!is_dir($unixPath.$path)) {
$create = $this->getInput("Unit test directory does not exist. Create it?", array('y','n'), 'y');
if (low($create) == 'y' || low($create) == 'yes') {
$build = array();
foreach(explode(DS, $path) as $i => $dir) {
$build[] = $dir;
if (!is_dir(DS.implode(DS, $build))) {
mkdir(DS.implode(DS, $build));
if (!is_dir($unixPath.implode(DS, $build))) {
mkdir($unixPath.implode(DS, $build));
}
}
}
}
$this->createFile(DS.$path.DS.$filename, $out);
$this->createFile($unixPath.$path.DS.$filename, $out);
}
}
/**