update python.ts
This commit is contained in:
@@ -19,8 +19,8 @@ const PYTHON_VENV_DEFAULT_BASE_DIR = "~/.venv/";
|
||||
|
||||
interface PythonConfig {
|
||||
python_venv_base_path?: string;
|
||||
versions: Map<string, PythonVersion>;
|
||||
profiles?: Map<string, PythonVenv>;
|
||||
versions: Record<string, PythonVersion>;
|
||||
profiles?: Record<string, PythonVenv>;
|
||||
}
|
||||
|
||||
interface PythonVersion {
|
||||
@@ -377,21 +377,22 @@ python.ts remove-venv --venv test-env`);
|
||||
pythonVenvProfile,
|
||||
);
|
||||
|
||||
const yesOrNo = prompt("Please confirm (yes/no):");
|
||||
if (yesOrNo === "yes" || yesOrNo === "y") {
|
||||
if (confirm("Please confirm:")) {
|
||||
const path = pythonVenvProfile.path;
|
||||
log.info(`Remove path: ${path}`);
|
||||
await new ProcessBar(`Removing path ${path}`).call(async () => {
|
||||
await Deno.remove(path, { recursive: true });
|
||||
});
|
||||
delete pythonConfig.profiles[flags.venv];
|
||||
if (pythonConfig.profiles) {
|
||||
delete pythonConfig.profiles[flags.venv];
|
||||
}
|
||||
await savePythonConfig(pythonConfig);
|
||||
log.success(
|
||||
`Virtual environment: '${flags.venv}' removed, path: ${path}`,
|
||||
);
|
||||
} else {
|
||||
console.log(
|
||||
`Your input '${yesOrNo}', skip remove the virtual environment`,
|
||||
`Your skip virtual environment removal`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -474,5 +475,5 @@ async function main() {
|
||||
|
||||
main().catch((e) => log.error(e));
|
||||
|
||||
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260125T224529+08:00.MEUCIQCxxJGIlQDOd0HEbsC0
|
||||
// 1WCLBtgT7T2TMyTgs9TMCWw97QIgINUQ6SNPJ0NePXi12pp66pCoxh37VqSqaE9TURldmNs=
|
||||
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260126T003238+08:00.MEYCIQDwBR9b75cKiOgaUUP3
|
||||
// Jt4TPZBF2CDBh1cKKC4MgNSWNwIhAINFBhTxBWfomgo9uYcAYpYBM4ngc/F/jrAV+hnnO0/H
|
||||
|
||||
Reference in New Issue
Block a user