Conversation
|
|
||
| namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks | ||
| { | ||
| public class WorkloadUpdateTask : GithubTask |
There was a problem hiding this comment.
Not expecting this file as it is in another PR already
There was a problem hiding this comment.
The reason is that this branche is based on other one.
| { | ||
| public class InstallPlaywrightTask : GithubTask | ||
| { | ||
| public override string Run { get; set; } = "dotnet tool install --global Microsoft.Playwright.CLI"; |
There was a problem hiding this comment.
Not expecting this as we have another PR for this. Can you remove this file.
There was a problem hiding this comment.
The reason is that this branche is based on other one.
|
|
||
| namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks | ||
| { | ||
| public class InstallPlaywrightBrowsersTask : GithubTask |
| { | ||
| [YamlIgnore] | ||
| public string ProjectName { get; set; } | ||
| public override string Run => $"pwsh ./{ProjectName}/bin/Debug/net9.0/playwright.ps1 install"; |
There was a problem hiding this comment.
Add documentation to show the default command so consumers can know when to override it with additional arguments
There was a problem hiding this comment.
Just using ProjectName as a property is not enforcing its use. I would suggest taking that value in via a constructor so consumer does not have to figure out what is needed.
/// <summary>
/// Represents a task that installs Playwright browsers for a given project.
/// </summary>
public class InstallPlaywrightBrowsersTask : GithubTask
{
/// <summary>
/// Initializes a new instance of the <see cref="InstallPlaywrightBrowsersTask"/> class.
/// </summary>
/// <param name="projectName">The name of the project for which Playwright browsers should be installed.</param>
public InstallPlaywrightBrowsersTask(string projectName)
{
this.projectName = projectName;
}
/// <summary>
/// Gets or sets the name of the task.
/// The default value is: "Install Microsoft.Playwright.CLI".
/// </summary>
public override string Name { get; set; } = "Install Microsoft.Playwright.CLI.";
/// <summary>
/// Gets the command to execute for the task.
/// The command installs Playwright browsers by running the Playwright CLI script.
/// The default value is: "pwsh ./{projectName}/bin/Debug/net9.0/playwright.ps1 install".
/// </summary>
public override string Run => $"pwsh ./{projectName}/bin/Debug/net9.0/playwright.ps1 install";
private readonly string projectName;
}There was a problem hiding this comment.
I also added .NET version as parameter:
public InstallPlaywrightBrowsersTask(
string projectName,
string dotnetVersion = "net9.0")
{
this.projectName = projectName;
this.dotnetVersion = dotnetVersion;
}
closes #138