33 lines
568 B
PHP
33 lines
568 B
PHP
<?php
|
|
namespace taskman;
|
|
use Exception;
|
|
|
|
task('dotnet_set_env', ['always' => true], function() {
|
|
dotnet_set_env();
|
|
});
|
|
|
|
task('dotnet_install', function() {
|
|
DotnetSupport::install();
|
|
});
|
|
|
|
function dotnet_shell($cmd)
|
|
{
|
|
shell('dotnet ' . $cmd);
|
|
}
|
|
|
|
function dotnet_shell_get($cmd)
|
|
{
|
|
return shell_get('dotnet ' . $cmd);
|
|
}
|
|
|
|
function dotnet_set_env()
|
|
{
|
|
putenv("DOTNET_CLI_TELEMETRY_OPTOUT=1");
|
|
|
|
$dotnet_path = DotnetSupport::getPath();
|
|
if(is_win())
|
|
putenv("PATH=$dotnet_path;".getenv('PATH'));
|
|
else
|
|
putenv("PATH=$dotnet_path:".getenv('PATH'));
|
|
}
|