From ff387a722e573b1bf24b7e04b6ce5e6982b1e540 Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Sat, 23 Jul 2016 20:19:33 +0200 Subject: [PATCH] fix exception when dotnet cli is not installed. --- src/app/FakeLib/DotNetCLIHelper.fs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app/FakeLib/DotNetCLIHelper.fs b/src/app/FakeLib/DotNetCLIHelper.fs index e2d7fa67de5..38189d56076 100644 --- a/src/app/FakeLib/DotNetCLIHelper.fs +++ b/src/app/FakeLib/DotNetCLIHelper.fs @@ -1,5 +1,5 @@ /// Contains a task which can be used to run dotnet CLI commands. -module Fake.DotNet +module Fake.DotNetCli open Fake open System @@ -43,13 +43,15 @@ let getVersion() = /// Checks wether the dotnet CLI is installed let isInstalled() = - let processResult = - ExecProcessAndReturnMessages (fun info -> - info.FileName <- commandName - info.WorkingDirectory <- Environment.CurrentDirectory - info.Arguments <- "--version") (TimeSpan.FromMinutes 30.) - - processResult.OK + try + let processResult = + ExecProcessAndReturnMessages (fun info -> + info.FileName <- commandName + info.WorkingDirectory <- Environment.CurrentDirectory + info.Arguments <- "--version") (TimeSpan.FromMinutes 30.) + + processResult.OK + with _ -> false /// DotNet parameters type CommandParams = {