Skip to content

Commit

Permalink
[skip-edge] Revert "sanitize the PATH env in virtual environment"
Browse files Browse the repository at this point in the history
This reverts commit 88a393b.
  • Loading branch information
th3w1zard1 committed Feb 24, 2024
1 parent bcddef4 commit 598187e
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions install_python_venv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ param(
[switch]$noprompt
)

if (-not $venv_name -or $venv_name.Trim() -eq '') {
$venv_name = ".venv"
}

$repoRootPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
function Get-OS {
if ($IsWindows) {
Expand Down Expand Up @@ -660,18 +656,13 @@ if ( $findVenvExecutable -eq $true) {


Write-Host "Activating venv at '$venvPath'"
$originalPath = $env:PATH -split ';'
if ((Get-OS) -eq "Windows") {
. $venvPath\Scripts\Activate.ps1
} else {
. $venvPath/bin/Activate.ps1
}
# sanitize $PATH, otherwise pyinstaller will act up...
$modifiedPath = $env:PATH -split ';'
$addedPaths = $modifiedPath | Where-Object { $originalPath -notcontains $_ }
$env:PATH = $addedPaths -join ';'

Write-Output "Sanitized PATH env: $env:PATH"
Initialize-Python $pythonExePath

# Set environment variables from .env file
$dotenv_path = "$repoRootPath$pathSep.env"
Expand Down

0 comments on commit 598187e

Please sign in to comment.