瀏覽代碼

Added path to exceptions thrown in enforceCleanDirectory for Hg & Svn also; Imporved exception when git log cannot be run by Compiler

Konstantin Tjuterev 13 年之前
父節點
當前提交
49491a9140
共有 3 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      src/Composer/Compiler.php
  2. 1 1
      src/Composer/Downloader/HgDownloader.php
  3. 1 1
      src/Composer/Downloader/SvnDownloader.php

+ 2 - 2
src/Composer/Compiler.php

@@ -35,9 +35,9 @@ class Compiler
             unlink($pharFile);
             unlink($pharFile);
         }
         }
 
 
-        $process = new Process('git log --pretty="%h" -n1 HEAD');
+        $process = new Process('git log --pretty="%h" -n1 HEAD', __DIR__);
         if ($process->run() != 0) {
         if ($process->run() != 0) {
-            throw new \RuntimeException('The git binary cannot be found or compile was run not inside git repository folder.');
+            throw new \RuntimeException('Can\'t run git log. You must ensure to run compile from composer git repository clone and that git binary is available.');
         }
         }
         $this->version = trim($process->getOutput());
         $this->version = trim($process->getOutput());
 
 

+ 1 - 1
src/Composer/Downloader/HgDownloader.php

@@ -50,7 +50,7 @@ class HgDownloader extends VcsDownloader
     {
     {
         $this->process->execute(sprintf('cd %s && hg st', escapeshellarg($path)), $output);
         $this->process->execute(sprintf('cd %s && hg st', escapeshellarg($path)), $output);
         if (trim($output)) {
         if (trim($output)) {
-            throw new \RuntimeException('Source directory has uncommitted changes');
+            throw new \RuntimeException('Source directory ' . $path . ' has uncommitted changes');
         }
         }
     }
     }
 }
 }

+ 1 - 1
src/Composer/Downloader/SvnDownloader.php

@@ -51,7 +51,7 @@ class SvnDownloader extends VcsDownloader
     {
     {
         $this->process->execute(sprintf('cd %s && svn status', escapeshellarg($path)), $output);
         $this->process->execute(sprintf('cd %s && svn status', escapeshellarg($path)), $output);
         if (trim($output)) {
         if (trim($output)) {
-            throw new \RuntimeException('Source directory has uncommitted changes');
+            throw new \RuntimeException('Source directory ' . $path . ' has uncommitted changes');
         }
         }
     }
     }
 }
 }