Skip to content

Commit

Permalink
Use local composer executable through TaskLibrary
Browse files Browse the repository at this point in the history
  • Loading branch information
CHH committed Nov 28, 2013
1 parent 8a70dde commit 6ac8475
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/phpunit.xml
/vendor/
/coverage/
/composer.phar
10 changes: 5 additions & 5 deletions bob_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
'testing.dist_config' => 'phpunit.xml.dist'
));

register(new \Bob\Library\ComposerLibrary);

# The "default" task is invoked when there's no
# task explicitly given on the command line.
task('default', array('phar'));
Expand Down Expand Up @@ -43,10 +45,12 @@

info(sprintf('----> Setting version to "v%s"', $version));

$contents = file_get_contents('lib/Bob.php');

$contents = preg_replace(
'/(\s*)(const VERSION = ".+")/',
sprintf('\1const VERSION = "v%s"', $version),
file_get_contents('lib/Bob.php')
$contents
);

file_put_contents('lib/Bob.php', $contents);
Expand Down Expand Up @@ -89,10 +93,6 @@
unset($phar);
});

fileTask('composer.lock', array('composer.json'), function() {
sh('composer update');
});

desc('Does a system install of Bob, by default to /usr/local/bin');
task('install', array('bin/bob.phar'), function($task) {
$prefix = getenv('PREFIX') ?: '/usr/local';
Expand Down

0 comments on commit 6ac8475

Please sign in to comment.