28 lines
801 B
C#
28 lines
801 B
C#
using System.CommandLine;
|
|
using MycroForge.CLI.Commands.Interfaces;
|
|
|
|
namespace MycroForge.CLI.Commands;
|
|
|
|
public partial class MycroForge
|
|
{
|
|
public class Hydrate : Command, ISubCommandOf<MycroForge>
|
|
{
|
|
private readonly ProjectContext _context;
|
|
|
|
public Hydrate(ProjectContext context)
|
|
: base("hydrate", "Initialize venv and install dependencies from requirements.txt")
|
|
{
|
|
_context = context;
|
|
this.SetHandler(ExecuteAsync);
|
|
}
|
|
|
|
private async Task ExecuteAsync()
|
|
{
|
|
await _context.Bash(
|
|
"python3 -m venv .venv",
|
|
"source .venv/bin/activate",
|
|
"python3 -m pip install -r requirements.txt"
|
|
);
|
|
}
|
|
}
|
|
} |