private static List <string> AddProvisioners(VagrantProvisionerSettings settings, IEnumerable <string> provisioners) { var l = settings.Provisioners.ToList(); l.AddRange(provisioners); settings.RunProvisioners = l.Any(); return(l); }
/// <summary> /// Adds the given provisioners to run during the operation /// </summary> /// <param name="settings">The settings</param> /// <param name="provisioners">List of provisioner names to run</param> /// <returns>The updated settings object</returns> public static VagrantProvisionerSettings WithProvisioners(this VagrantProvisionerSettings settings, IEnumerable <string> provisioners) { settings.Provisioners = AddProvisioners(settings, provisioners); return(settings); }
/// <summary> /// Adds the given provisioners to run during the operation /// </summary> /// <param name="settings">The settings</param> /// <param name="provisioners">Collection of provisioner names to run</param> /// <returns>The updated settings object</returns> public static VagrantProvisionerSettings WithProvisioners(this VagrantProvisionerSettings settings, params string[] provisioners) { settings.Provisioners = AddProvisioners(settings, provisioners); return(settings); }
/// <summary> /// Force the provisioners to run during the operation /// </summary> /// <param name="settings">The settings</param> /// <param name="run"><c>true</c> to run provisioners, <c>false</c> to skip</param> /// <returns>The updated settings object</returns> public static VagrantProvisionerSettings RunProvisioners(this VagrantProvisionerSettings settings, bool run = true) { settings.RunProvisioners = run; return(settings); }