forked from platformio/platformio-core
22 lines
668 B
Python
22 lines
668 B
Python
![]() |
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||
|
# See LICENSE for details.
|
||
|
|
||
|
from click import argument, command, secho
|
||
|
|
||
|
from platformio.exception import PlatformNotInstalledYet
|
||
|
from platformio.pkgmanager import PackageManager
|
||
|
from platformio.platforms._base import PlatformFactory
|
||
|
|
||
|
|
||
|
@command("uninstall", short_help="Uninstall the platforms")
|
||
|
@argument("platform")
|
||
|
def cli(platform):
|
||
|
|
||
|
if platform not in PackageManager.get_installed():
|
||
|
raise PlatformNotInstalledYet(platform)
|
||
|
|
||
|
p = PlatformFactory().newPlatform(platform)
|
||
|
if p.uninstall():
|
||
|
secho("The platform '%s' has been successfully "
|
||
|
"uninstalled!" % platform, fg="green")
|