taskman_dotnet/dotnet.inc.php

33 lines
568 B
PHP
Raw Permalink Normal View History

2024-09-23 18:27:20 +03:00
<?php
namespace taskman;
2024-09-23 19:36:59 +03:00
use Exception;
2024-09-23 18:27:20 +03:00
2024-09-23 19:02:14 +03:00
task('dotnet_set_env', ['always' => true], function() {
dotnet_set_env();
2024-09-23 18:27:20 +03:00
});
task('dotnet_install', function() {
DotnetSupport::install();
});
function dotnet_shell($cmd)
{
shell('dotnet ' . $cmd);
}
function dotnet_shell_get($cmd)
{
return shell_get('dotnet ' . $cmd);
}
2024-09-23 19:02:14 +03:00
function dotnet_set_env()
2024-09-23 18:27:20 +03:00
{
2024-09-23 19:02:14 +03:00
putenv("DOTNET_CLI_TELEMETRY_OPTOUT=1");
2024-09-23 19:34:41 +03:00
$dotnet_path = DotnetSupport::getPath();
2024-09-23 18:27:20 +03:00
if(is_win())
putenv("PATH=$dotnet_path;".getenv('PATH'));
else
putenv("PATH=$dotnet_path:".getenv('PATH'));
}