first version

This commit is contained in:
Pavel Shevaev 2022-05-18 10:39:08 +03:00
commit 0c652e80cf
2 changed files with 47 additions and 0 deletions

11
composer.json Normal file
View File

@ -0,0 +1,11 @@
{
"name": "bit/taskman_deps",
"description": "taskman deps utils",
"homepage": "https://git.bit5.ru/composer/taskman_deps",
"require": {
"php": ">=7.4"
},
"autoload": {
"classmap": ["deps.inc.php"]
}
}

36
deps.inc.php Normal file
View File

@ -0,0 +1,36 @@
<?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;
}