mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Fix "clean" target
This commit is contained in:
@ -89,12 +89,6 @@ if not int(ARGUMENTS.get("PIOVERBOSE", 0)):
|
|||||||
|
|
||||||
env = DefaultEnvironment(**DEFAULT_ENV_OPTIONS)
|
env = DefaultEnvironment(**DEFAULT_ENV_OPTIONS)
|
||||||
|
|
||||||
if env.GetOption('clean'):
|
|
||||||
env.PioClean(env.subst("$BUILD_DIR"))
|
|
||||||
env.Exit(0)
|
|
||||||
elif not int(ARGUMENTS.get("PIOVERBOSE", 0)):
|
|
||||||
print("Verbose mode can be enabled via `-v, --verbose` option")
|
|
||||||
|
|
||||||
# Load variables from CLI
|
# Load variables from CLI
|
||||||
for key in list(clivars.keys()):
|
for key in list(clivars.keys()):
|
||||||
if key in env:
|
if key in env:
|
||||||
@ -102,6 +96,12 @@ for key in list(clivars.keys()):
|
|||||||
if isinstance(env[key], bytes):
|
if isinstance(env[key], bytes):
|
||||||
env[key] = env[key].decode()
|
env[key] = env[key].decode()
|
||||||
|
|
||||||
|
if env.GetOption('clean'):
|
||||||
|
env.PioClean(env.subst("$BUILD_DIR"))
|
||||||
|
env.Exit(0)
|
||||||
|
elif not int(ARGUMENTS.get("PIOVERBOSE", 0)):
|
||||||
|
print("Verbose mode can be enabled via `-v, --verbose` option")
|
||||||
|
|
||||||
env.GetProjectConfig().validate([env['PIOENV']], silent=True)
|
env.GetProjectConfig().validate([env['PIOENV']], silent=True)
|
||||||
env.LoadProjectOptions()
|
env.LoadProjectOptions()
|
||||||
env.LoadPioPlatform()
|
env.LoadPioPlatform()
|
||||||
|
@ -12,13 +12,12 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
import click
|
import click
|
||||||
from twisted.internet import protocol # pylint: disable=import-error
|
from twisted.internet import protocol # pylint: disable=import-error
|
||||||
|
|
||||||
from platformio.commands.debug import helpers
|
from platformio.commands.debug import helpers
|
||||||
from platformio.compat import string_types
|
from platformio.compat import string_types
|
||||||
|
from platformio.proc import get_pythonexe_path
|
||||||
from platformio.project.helpers import get_project_core_dir
|
from platformio.project.helpers import get_project_core_dir
|
||||||
|
|
||||||
LOG_FILE = None
|
LOG_FILE = None
|
||||||
@ -31,7 +30,7 @@ class BaseProcess(protocol.ProcessProtocol, object):
|
|||||||
COMMON_PATTERNS = {
|
COMMON_PATTERNS = {
|
||||||
"PLATFORMIO_HOME_DIR": helpers.escape_path(get_project_core_dir()),
|
"PLATFORMIO_HOME_DIR": helpers.escape_path(get_project_core_dir()),
|
||||||
"PLATFORMIO_CORE_DIR": helpers.escape_path(get_project_core_dir()),
|
"PLATFORMIO_CORE_DIR": helpers.escape_path(get_project_core_dir()),
|
||||||
"PYTHONEXE": os.getenv("PYTHONEXEPATH", "")
|
"PYTHONEXE": get_pythonexe_path()
|
||||||
}
|
}
|
||||||
|
|
||||||
def apply_patterns(self, source, patterns=None):
|
def apply_patterns(self, source, patterns=None):
|
||||||
|
Reference in New Issue
Block a user