updates
This commit is contained in:
@@ -10,8 +10,8 @@ import {
|
|||||||
readFileToString,
|
readFileToString,
|
||||||
resolveFilename,
|
resolveFilename,
|
||||||
} from "https://global.hatter.ink/script/get/@16/deno-commons-mod.ts";
|
} from "https://global.hatter.ink/script/get/@16/deno-commons-mod.ts";
|
||||||
import { parseArgs } from "jsr:@std/cli/parse-args";
|
import {parseArgs} from "jsr:@std/cli/parse-args";
|
||||||
import { writeStringToFile } from "../libraries/deno-commons-mod.ts";
|
import {writeStringToFile} from "../libraries/deno-commons-mod.ts";
|
||||||
|
|
||||||
const PYTHON_CONFIG_FILE = "~/.config/python-config.json";
|
const PYTHON_CONFIG_FILE = "~/.config/python-config.json";
|
||||||
const PYTHON_VENV_DEFAULT_BASE_DIR = "~/.venv/";
|
const PYTHON_VENV_DEFAULT_BASE_DIR = "~/.venv/";
|
||||||
@@ -358,18 +358,16 @@ python.ts remove-venv --venv test-env`);
|
|||||||
|
|
||||||
const yesOrNo = prompt("Please confirm (yes/no):");
|
const yesOrNo = prompt("Please confirm (yes/no):");
|
||||||
if (yesOrNo === "yes" || yesOrNo === "y") {
|
if (yesOrNo === "yes" || yesOrNo === "y") {
|
||||||
// DO CONFIRM YES
|
|
||||||
// TODO
|
|
||||||
const path = pythonVenvProfile.path;
|
const path = pythonVenvProfile.path;
|
||||||
log.info(`Remove path: ${path}`);
|
log.info(`Remove path: ${path}`);
|
||||||
|
|
||||||
await new ProcessBar(`Removing path ${path}`).call(async () => {
|
await new ProcessBar(`Removing path ${path}`).call(async () => {
|
||||||
await Deno.remove(path, { recursive: true });
|
await Deno.remove(path, { recursive: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
delete pythonConfig.profiles[flags.venv];
|
delete pythonConfig.profiles[flags.venv];
|
||||||
await savePythonConfig(pythonConfig);
|
await savePythonConfig(pythonConfig);
|
||||||
log.success(`Remove virtual environment: ${flags.venv}`);
|
log.success(
|
||||||
|
`Virtual environment: '${flags.venv}' removed, path: ${path}`,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
`Your input '${yesOrNo}', skip remove the virtual environment`,
|
`Your input '${yesOrNo}', skip remove the virtual environment`,
|
||||||
|
|||||||
Reference in New Issue
Block a user