From de295d616413c76ecb6916ac9d716d283cb2c8cc Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Sun, 23 Aug 2015 16:10:20 -0700 Subject: [PATCH] RunTargetOrListTargets() --- src/app/FakeLib/AdditionalSyntax.fs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/FakeLib/AdditionalSyntax.fs b/src/app/FakeLib/AdditionalSyntax.fs index c5f1f21f72d..2e45d60344a 100644 --- a/src/app/FakeLib/AdditionalSyntax.fs +++ b/src/app/FakeLib/AdditionalSyntax.fs @@ -28,6 +28,11 @@ let RunParameterTargetOrDefault parameterName defaultTarget = getBuildParamOrDef /// Runs the target given by the target parameter or the given default target let RunTargetOrDefault defaultTarget = getBuildParamOrDefault "target" defaultTarget |> Run +/// Runs the target given by the target parameter or lists the available targets +let RunTargetOrListTargets() = + if hasBuildParam "target" then getBuildParam "target" |> Run + else listTargets() + /// Runs the target given by the target parameter let RunTarget() = getBuildParam "target" |> Run @@ -63,4 +68,4 @@ let inline (<=>) x y = y /// Defines a conditional dependency - y is dependent on x if the condition is true -let inline (=?>) x (y,condition) = if condition then x ==> y else x \ No newline at end of file +let inline (=?>) x (y,condition) = if condition then x ==> y else x