first version
This commit is contained in:
commit
0c652e80cf
|
@ -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"]
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue