in src/artifacts-credprovider-conda/src/activate/artifacts-cred.py [0:0]
def __init__(self):
if sys.platform.startswith("win"):
tool_path = os.path.join(
os.path.abspath(os.environ['UserProfile']),
".nuget",
"plugins",
"netfx",
"CredentialProvider.Microsoft",
"CredentialProvider.Microsoft.exe",
)
self.exe = [tool_path]
else:
try:
sys_version = tuple(int(i) for i in
subprocess.check_output(["dotnet", "--version"]).decode().strip().partition("-")[0].split("."))
get_runtime_path = lambda: "dotnet"
except Exception as e:
message = (
"Unable to find dependency dotnet, please manually install"
" the .NET SDK and ensure 'dotnet' is in your PATH. Error: "
)
raise Exception(message + str(e))
tool_path = os.path.join(
os.path.abspath(os.environ['HOME']),
".nuget",
"plugins",
"netcore",
"CredentialProvider.Microsoft",
"CredentialProvider.Microsoft.dll",
)
self.exe = [get_runtime_path(), "exec", tool_path]
if not os.path.exists(tool_path):
raise RuntimeError("Unable to find credential provider in the expected path: " + tool_path)