Skip to content

Commit

Permalink
Add Laravel version switch parameter (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebathman authored and tillkruss committed Aug 3, 2018
1 parent 7e76235 commit e38709e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion laravel.php
Expand Up @@ -8,7 +8,16 @@
require __DIR__ . '/vendor/autoload.php';

$query = $argv[1];
$branch = empty($_ENV['branch']) ? 'master' : $_ENV['branch'];

preg_match('/^\h*?v?(master|(?:[\d]+)(?:\.[\d]+)?(?:\.[\d]+)?)?\h*?(.*?)$/', $query, $matches);

if (! empty(trim($matches[1]))) {
$branch = $matches[1];
$query = $matches[2];
} else {
$branch = empty($_ENV['branch']) ? 'master' : $_ENV['branch'];
}

$subtext = empty($_ENV['alfred_theme_subtext']) ? '0' : $_ENV['alfred_theme_subtext'];

$workflow = new Workflow;
Expand Down

0 comments on commit e38709e

Please sign in to comment.