Simplifying composer update logic

This commit is contained in:
Pavel Shevaev 2022-05-18 12:33:18 +03:00
parent 0c652e80cf
commit 4abd925a9a
1 changed files with 1 additions and 12 deletions

View File

@ -1,17 +1,6 @@
<?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();
@ -21,6 +10,7 @@ function update_composer()
{
global $GAME_ROOT;
include("$GAME_ROOT/composer/update.php");
touch("$GAME_ROOT/composer/composer.last");
}
function try_update_composer()
@ -31,6 +21,5 @@ function try_update_composer()
return false;
update_composer();
touch("$GAME_ROOT/composer/composer.last");
return true;
}