Merge pull request #308 from corpsee/master

A few fixes
This commit is contained in:
Dan Cryer 2014-03-20 16:14:11 +00:00
commit eaf01e6ae2
2 changed files with 12 additions and 2 deletions

View file

@ -216,7 +216,12 @@ class Builder implements LoggerAwareInterface
// Clean up:
$this->buildLogger->log('Removing build.');
shell_exec(sprintf('rm -Rf "%s"', $this->buildPath));
$cmd = 'rm -Rf "%s"';
if (IS_WIN) {
$cmd = 'rmdir /S /Q "%s"';
}
$this->executeCommand($cmd, $this->buildPath);
// Update the build in the database, ping any external services, etc.
$this->build->sendStatusPostback();

View file

@ -17,6 +17,7 @@ use b8\Config;
use b8\Controller;
use b8\Store;
use b8\Form;
use b8\Exception\HttpException\NotFoundException;
/**
* Project Controller - Allows users to create, edit and view projects.
@ -47,7 +48,11 @@ class ProjectController extends \PHPCI\Controller
*/
public function view($projectId)
{
$project = $this->projectStore->getById($projectId);
$project = $this->projectStore->getById($projectId);
if (!$project) {
throw new NotFoundException('Project with id: ' . $projectId . ' not found');
}
$page = $this->getParam('p', 1);
$builds = $this->getLatestBuildsHtml($projectId, (($page - 1) * 10));