Skip to content

Commit

Permalink
Auto-enable the venv and PATH settings in vscode on Windows. Backport…
Browse files Browse the repository at this point in the history
… candidate.
  • Loading branch information
cwidisgroup committed Nov 27, 2024
1 parent c9f1ae9 commit c5b7b06
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,28 @@
"text_encoding": "cpp",
"execution": "cpp"
},
"cmake.ctest.allowParallelJobs": true
"cmake.ctest.allowParallelJobs": true,
"terminal.integrated.profiles.windows": {

"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell",
"args": [
"-noexit",
"-file",
"${workspaceFolder}\\scripts\\activate.ps1"
]
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash"
}
}
}
5 changes: 5 additions & 0 deletions scripts/activate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ if (Test-Path -Path $candidate1BinDir) {
$binDir = $buildDir + "\bin"
}
Write-Output "binDir = " + $binDir
$binDirExists = Test-Path $binDir
if (-Not $binDirExists) {
Write-Output "binDir does not exist. Not enabling venv"
exit
}
$Env:CWIPC_LIBRARY_DIR = $binDir
$Env:PATH = $binDir + ";" + $Env:PATH
Write-Output $Env:PATH
Expand Down

0 comments on commit c5b7b06

Please sign in to comment.