- Corrected code-smell and code style issues in \ncc\Classes > BashExtension > BashRunner

This commit is contained in:
Netkas 2023-08-17 14:08:22 -04:00
parent d4709443f7
commit 84e5e5a346
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
2 changed files with 7 additions and 3 deletions

View file

@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Corrected code-smell and code style issues in `\ncc\Classes > HttpClient`
- Corrected code-smell and code style issues in `\ncc\Classes > GitClient`
- Corrected code-smell and code style issues in `\ncc\Classes > BashExtension > BashRunner`

View file

@ -36,13 +36,17 @@ namespace ncc\Classes\BashExtension;
*/
public static function processUnit(string $path, ExecutionPolicy $policy): ExecutionUnit
{
$execution_unit = new ExecutionUnit();
if(!file_exists($path) && !is_file($path))
{
throw new FileNotFoundException($path);
$policy->Execute->Target = null;
}
$execution_unit = new ExecutionUnit();
$execution_unit->ExecutionPolicy = $policy;
$execution_unit->Data = IO::fread($path);
$policy->Execute->Target = null;
return $execution_unit;
}