mirror of
https://github.com/kennethreitz-archive/python-build.git
synced 2026-06-05 23:30:18 +00:00
update venv command
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
from pythonbrew.basecommand import Command
|
||||
from pythonbrew.define import PATH_PYTHONS, PATH_BIN
|
||||
from pythonbrew.define import PATH_PYTHONS, PATH_BIN, PATH_VENVS
|
||||
from pythonbrew.util import off, rm_r, Package, get_using_python_pkgname, unlink,\
|
||||
is_installed
|
||||
from pythonbrew.log import logger
|
||||
@@ -17,6 +17,7 @@ class UninstallCommand(Command):
|
||||
pkg = Package(arg)
|
||||
pkgname = pkg.name
|
||||
pkgpath = os.path.join(PATH_PYTHONS, pkgname)
|
||||
venvpath = os.path.join(PATH_VENVS, pkgname)
|
||||
if not is_installed(pkgname):
|
||||
logger.info("`%s` is not installed." % pkgname)
|
||||
continue
|
||||
@@ -31,6 +32,7 @@ class UninstallCommand(Command):
|
||||
if os.path.isfile(tgtpath) and os.path.samefile(path, tgtpath):
|
||||
unlink(path)
|
||||
rm_r(pkgpath)
|
||||
rm_r(venvpath)
|
||||
else:
|
||||
self.parser.print_help()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user