37 lines
725 B
PHP
37 lines
725 B
PHP
|
<?php
|
||
|
namespace taskman;
|
||
|
|
||
|
task('try_deps_update', ['always' => true], function()
|
||
|
{
|
||
|
global $GAME_ROOT;
|
||
|
|
||
|
if(try_update_composer())
|
||
|
echo "Composer was updated...\n";
|
||
|
|
||
|
if(file_exists("$GAME_ROOT/composer/vendor/composer/autoload_real.php"))
|
||
|
include_once("$GAME_ROOT/composer/vendor/autoload.php");
|
||
|
});
|
||
|
|
||
|
task('deps_update', function()
|
||
|
{
|
||
|
update_composer();
|
||
|
});
|
||
|
|
||
|
function update_composer()
|
||
|
{
|
||
|
global $GAME_ROOT;
|
||
|
include("$GAME_ROOT/composer/update.php");
|
||
|
}
|
||
|
|
||
|
function try_update_composer()
|
||
|
{
|
||
|
global $GAME_ROOT;
|
||
|
|
||
|
if(!need_to_regen("$GAME_ROOT/composer/composer.last", ["$GAME_ROOT/composer/composer.json"]))
|
||
|
return false;
|
||
|
|
||
|
update_composer();
|
||
|
touch("$GAME_ROOT/composer/composer.last");
|
||
|
return true;
|
||
|
}
|