Browse Source

Adjustments as per comments.

Mark Scherer 10 years ago
parent
commit
dce3f1f09e
2 changed files with 3 additions and 7 deletions
  1. 1 5
      src/Shell/I18nShell.php
  2. 2 2
      tests/TestCase/Shell/I18nShellTest.php

+ 1 - 5
src/Shell/I18nShell.php

@@ -102,12 +102,8 @@ class I18nShell extends Shell
             $filename = $fileinfo->getFilename();
             $newFilename = $fileinfo->getBasename('.pot');
             $newFilename = $newFilename . '.po';
-            if (!$this->param('force') && is_file($targetFolder . $newFilename)) {
-                $this->err('File ' . $newFilename . ' exists, skipping. Use --force or -f to force overwriting');
-                continue;
-            }
 
-            copy($sourceFolder . $filename, $targetFolder . $newFilename);
+            $this->createFile($targetFolder . $newFilename, file_get_contents($sourceFolder . $filename));
             $count++;
         }
 

+ 2 - 2
tests/TestCase/Shell/I18nShellTest.php

@@ -78,7 +78,7 @@ class I18nShellTest extends TestCase
         $this->shell->params['verbose'] = true;
         $this->shell->init();
 
-        $this->assertTrue(file_exists($deDir . 'default.po'));
-        $this->assertTrue(file_exists($deDir . 'cake.po'));
+        $this->assertFileExists($deDir . 'default.po');
+        $this->assertFileExists($deDir . 'cake.po');
     }
 }