mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-13 08:15:14 +02:00
fix: restore artifact smoke python env helper
This commit is contained in:
parent
bf3fc0cb7c
commit
31d173f7f7
1 changed files with 11 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ import { createHash } from 'node:crypto';
|
|||
import { execFile } from 'node:child_process';
|
||||
import { access, mkdir, mkdtemp, readFile, readdir, rm, writeFile } from 'node:fs/promises';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
||||
import { delimiter, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
|
||||
import {
|
||||
|
|
@ -1224,6 +1224,16 @@ function pythonExecutable(projectDir) {
|
|||
return join(projectDir, '.venv', 'bin', 'python');
|
||||
}
|
||||
|
||||
export function npmSmokePythonEnv(projectDir, baseEnv = process.env) {
|
||||
const binDir = process.platform === 'win32' ? join(projectDir, '.venv', 'Scripts') : join(projectDir, '.venv', 'bin');
|
||||
const existingPath = baseEnv.PATH ?? '';
|
||||
|
||||
return {
|
||||
...baseEnv,
|
||||
PATH: existingPath ? `${binDir}${delimiter}${existingPath}` : binDir,
|
||||
};
|
||||
}
|
||||
|
||||
async function buildArtifacts(layout) {
|
||||
await rm(layout.artifactDir, { recursive: true, force: true });
|
||||
await mkdir(layout.npmDir, { recursive: true });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue