/// <summary> /// Runs a dnx command, automatically switching the runtime (ie. dnvm use) based on /// config.<see cref="DNXRunSettings.EstimatedRuntime"/> property if this estimated runtime is /// not the current one (see <see cref="GetDNXRuntimeInformation"/>). /// </summary> /// <param name="context">This cake context.</param> /// <param name="config">The configuration to use.</param> public static void DNXRun( this ICakeContext context, Action<DNXRunSettings> config ) { var c = new DNXRunSettings(); config( c ); var b = new StringBuilder(); var current = GetDNXRuntimeInformation( context ); if( c.EstimatedRuntime != null && c.EstimatedRuntime != current.Runtime ) { b.Append( "dnvm use " ).Append( current.Version ).Append( " -r " ).Append( c.EstimatedRuntime ).Append( " && " ); } b.Append( "dnx " ); c.ToString( b ); RunCmdAliases.RunCmdSuccessful( context, b.ToString() ); }
/// <summary> /// Runs a dnx command, automatically switching the runtime (ie. dnvm use) based on /// config.<see cref="DNXRunSettings.EstimatedRuntime"/> property if this estimated runtime is /// not the current one (see <see cref="GetDNXRuntimeInformation"/>). /// </summary> /// <param name="context">This cake context.</param> /// <param name="config">The configuration to use.</param> public static void DNXRun(this ICakeContext context, Action <DNXRunSettings> config) { var c = new DNXRunSettings(); config(c); var b = new StringBuilder(); var current = GetDNXRuntimeInformation(context); if (c.EstimatedRuntime != null && c.EstimatedRuntime != current.Runtime) { b.Append("dnvm use ").Append(current.Version).Append(" -r ").Append(c.EstimatedRuntime).Append(" && "); } b.Append("dnx "); c.ToString(b); RunSuccessfullCmd(context, b.ToString()); }