forked from platformio/platformio-core
Fix package removing when it is symbolically linked
This commit is contained in:
@ -13,7 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from os.path import dirname, isdir, isfile, join
|
from os.path import dirname, isdir, isfile, islink, join
|
||||||
from shutil import copyfile, copytree, rmtree
|
from shutil import copyfile, copytree, rmtree
|
||||||
|
|
||||||
import click
|
import click
|
||||||
@ -246,7 +246,11 @@ class PackageManager(object):
|
|||||||
continue
|
continue
|
||||||
found = True
|
found = True
|
||||||
if isfile(manifest['_manifest_path']):
|
if isfile(manifest['_manifest_path']):
|
||||||
rmtree(dirname(manifest['_manifest_path']))
|
pkg_dir = dirname(manifest['_manifest_path'])
|
||||||
|
if islink(pkg_dir):
|
||||||
|
os.unlink(pkg_dir)
|
||||||
|
else:
|
||||||
|
rmtree(pkg_dir)
|
||||||
|
|
||||||
if not found:
|
if not found:
|
||||||
click.secho("Not installed", fg="yellow")
|
click.secho("Not installed", fg="yellow")
|
||||||
|
Reference in New Issue
Block a user