Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Apparently venv auto detection works
Browse files Browse the repository at this point in the history
Reverted commit 8111276
  • Loading branch information
gilnobrega committed Jun 15, 2021
1 parent 2d80406 commit a8b0300
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/extensions/swarpm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,27 @@ class SwarPM {
io.Directory.current = managerPath;
if (io.Platform.isWindows) {
String binaryPath = "python";

/*
const String venvPath = "venv/Scripts/python.exe";

//if it detects venv then launches it from there
if (io.File(venvPath).existsSync()) binaryPath = venvPath;*/
if (io.File(venvPath).existsSync()) binaryPath = venvPath;

jsonOutput =
io.Process.runSync(binaryPath, const ["manager.py", "json"])
.stdout;
} else {
/*
const List<String> venvPaths = const [
"venv/bin/python3",
"venv/bin/python"
];

for (String venvPath in venvPaths) {
//if it detects venv then launches it from there
if (io.File(venvPath).existsSync())
if (io.File(venvPath).existsSync() && jsonOutput == '')
jsonOutput =
io.Process.runSync(venvPath, const ["manager.py", "json"])
.stdout;
}*/
}

if (jsonOutput == '')
jsonOutput = io.Process.runSync(
Expand Down

0 comments on commit a8b0300

Please sign in to comment.