Skip to content

Commit f2115f1

Browse files
authored
add uv to PATH after install
2 parents 95cf715 + d70e500 commit f2115f1

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pioarduino-node-helpers",
3-
"version": "12.1.1",
3+
"version": "12.1.2",
44
"description": "Collection of Node.JS helpers for PlatformIO fork pioarduino",
55
"main": "dist/index.js",
66
"engines": {

src/installer/get-python.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,18 @@ async function isUVAvailable() {
134134
}
135135
}
136136

137+
/**
138+
* Get UV executable path after installation
139+
* On Windows, UV is installed to %USERPROFILE%\.local\bin
140+
* On Unix/Linux/macOS, UV is installed to ~/.local/bin
141+
* @returns {string} Full path to UV executable
142+
*/
143+
function getUVExecutablePath() {
144+
const homeDir = process.env.USERPROFILE || process.env.HOME;
145+
const uvExe = proc.IS_WINDOWS ? 'uv.exe' : 'uv';
146+
return path.join(homeDir, '.local', 'bin', uvExe);
147+
}
148+
137149
/**
138150
* Install UV package manager using official installation scripts
139151
* Downloads and runs platform-specific installer from astral.sh
@@ -183,8 +195,15 @@ async function installPythonWithUV(destinationDir, pythonVersion = '3.13') {
183195
log('info', `Creating Python ${pythonVersion} venv using UV`);
184196

185197
// Ensure UV is available, install if necessary
198+
let uvCommand = 'uv';
186199
if (!(await isUVAvailable())) {
187200
await installUV();
201+
// On Windows, UV might not be in PATH immediately after installation
202+
// Use direct path to UV executable
203+
if (proc.IS_WINDOWS) {
204+
uvCommand = getUVExecutablePath();
205+
log('info', `Using UV from: ${uvCommand}`);
206+
}
188207
}
189208

190209
// Clean up any existing installation to avoid conflicts
@@ -200,7 +219,7 @@ async function installPythonWithUV(destinationDir, pythonVersion = '3.13') {
200219

201220
// Use --python-preference managed to allow UV to download Python if not found on system
202221
await execFile(
203-
'uv',
222+
uvCommand,
204223
[
205224
'venv',
206225
absolutePath,

0 commit comments

Comments
 (0)