Updated \ncc\Classes > GitClient > checkout() to update submoudles.

This commit is contained in:
Netkas 2023-07-13 19:24:28 -04:00
parent c2d0e6e23c
commit 56c59ba4f4
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
2 changed files with 25 additions and 0 deletions

View file

@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Refactored `\ncc\Objects > PackageLock`
- Updated `defuse\php-encryption` to version 2.4.0
- Updated `\ncc\Classes > GitClient > cloneRepositor()` to clone submodules recursively by default
- Updated `\ncc\Classes > GitClient > checkout()` to update submoudles.
### Fixed
- Fixed issue in `\ncc\Managers > ExecutionPointerManager > executeUnit()` where if ttyMode is enabled in a non-tty

View file

@ -84,9 +84,33 @@ namespace ncc\Classes;
});
if (!$process->isSuccessful())
{
throw new GitCheckoutException($process->getErrorOutput());
}
Console::outVerbose('Checked out branch: ' . $branch);
Console::outVerbose('Updating submodules');
$process = new Process(["git", "submodule", "update", "--init", "--recursive"], $path);
$process->setTimeout(3600); // 1 hour
$process->run(function ($type, $buffer)
{
if (Process::ERR === $type)
{
Console::outWarning($buffer);
}
else
{
Console::outVerbose($buffer);
}
});
if (!$process->isSuccessful())
{
throw new GitCheckoutException($process->getErrorOutput());
}
Console::outVerbose('Submodules updated');
}
/**