Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply fixes from StyleCI #275

Merged
merged 1 commit into from
Dec 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/Console/Commands/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Tapestry\Console\Commands;

use Tapestry\Exceptions\LockException;
use Tapestry\Tapestry;
use Tapestry\Exceptions\LockException;
use Symfony\Component\Console\Helper\Table;
use Tapestry\Exceptions\InvalidVersionException;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -29,11 +29,11 @@ public function execute(InputInterface $input, OutputInterface $output)
$this->input = $input;
$this->output = $output;

$lockFilePathname = $this->input->getOption('site-dir') . DIRECTORY_SEPARATOR . '.lock';
$lockFilePathname = $this->input->getOption('site-dir').DIRECTORY_SEPARATOR.'.lock';
$lockFile = fopen($lockFilePathname, 'w+');

if (flock($lockFile, LOCK_EX | LOCK_NB)) {
$result = (int)$this->fire();
$result = (int) $this->fire();
} else {
fclose($lockFile);
throw new LockException('Tapestry is already running; please wait for the previous process to complete or delete the .lock file.');
Expand All @@ -50,9 +50,11 @@ public function execute(InputInterface $input, OutputInterface $output)
} catch (InvalidVersionException $e) {
$this->failure('[!] '.$e->getMessage());
$this->failure(' If you would like to ignore this error, delete the cache file and try again.');

return 1;
} catch (\Exception $e) {
$this->failure($e->getMessage());

return 1;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Console/DefaultInputDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(array $definition = [])
new InputOption('--dist-dir', null, InputOption::VALUE_OPTIONAL, 'The destination directory'),
new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'Site environment', 'local'),
new InputOption('--stopwatch', '-s', InputOption::VALUE_NONE, 'Time how long the build took'),
new InputOption('--no-lock', '-l', InputOption::VALUE_NONE, 'Ignore lock file if exists.')
new InputOption('--no-lock', '-l', InputOption::VALUE_NONE, 'Ignore lock file if exists.'),
]);
parent::__construct($definition);
}
Expand Down