Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/App/models/os.validators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* File: \os.validators.cs
* Created: Monday, 28th July 2025 3:17:00 pm
* -----
* Last Modified: Sunday, 3rd August 2025 8:24:11 pm
* Last Modified: Tuesday, 5th August 2025 7:26:14 pm
* Modified By: tutosrive (tutosrive@Dev2Forge.software)
* -----
*/
Expand All @@ -34,6 +34,12 @@ interface IOsValidators
/// <returns>A bool that represents if <strong>requirements.txt</strong> exists</returns>
public abstract bool CheckRequirementsFile(string workingDir);
/// <summary>
/// Check that <strong>dependencies</strong> already install in the <strong>.venv</strong> directory
/// </summary>
/// <param name="workingDir">The path to the working directory</param>
/// <returns>A bool that represents if missing some <strong>dependencies</strong></returns>
public abstract Task<bool> CheckRequirementsPip(string workingDir);
/// <summary>
/// Validate that the string path of working directory is valid and exists
/// </summary>
/// <param name="path">The path to the working directory</param>
Expand Down
13 changes: 7 additions & 6 deletions src/App/os/windows/Validations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* File: \Validations.cs
* Created: Monday, 28th July 2025 3:15:01 pm
* -----
* Last Modified: Sunday, 3rd August 2025 9:11:09 pm
* Last Modified: Tuesday, 5th August 2025 7:46:40 pm
* Modified By: tutosrive (tutosrive@Dev2Forge.software)
* -----
*/
Expand Down Expand Up @@ -59,15 +59,16 @@ public async Task<bool> CheckPythonPaths()
}

/// <summary>
/// Validate if <strong>requirements</strong> already installed in the venv
/// Validate if <strong>requirements</strong> already installed in the venv.
/// See https://pip.pypa.io/en/stable/cli/pip_check/
/// </summary>
/// <returns>A bool that indicate if <strong>requirements</strong> already installed</returns>
public async Task<bool> CheckRequirementsPip()
public async Task<bool> CheckRequirementsPip(string workingDir)
{
// TODO: Fix me!
// TODO: Debug me!
bool ok = false;
CommandResult commandResult = await this._Runner.ExecuteCommandAsync("cmd.exe", this._commands.CheckRequirementsPip);
if (commandResult.Error.Trim().Equals("")) { ok = true; }
CommandResult commandResult = await this._Runner.ExecuteCommandAsync("cmd.exe", $"cd /d {workingDir} && {this._commands.ActivateVenv} && {this._commands.CheckRequirementsPip}");
if (commandResult.ExitCode == 0) { ok = true; }
return ok;
}

Expand Down