Fix "clean" target

This commit is contained in:
Ivan Kravets
2019-05-30 23:33:57 +03:00
parent 01db26f204
commit 1598c8197e
2 changed files with 8 additions and 9 deletions

View File

@ -89,12 +89,6 @@ if not int(ARGUMENTS.get("PIOVERBOSE", 0)):
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
for key in list(clivars.keys()):
if key in env:
@ -102,6 +96,12 @@ for key in list(clivars.keys()):
if isinstance(env[key], bytes):
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.LoadProjectOptions()
env.LoadPioPlatform()

View File

@ -12,13 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import click
from twisted.internet import protocol # pylint: disable=import-error
from platformio.commands.debug import helpers
from platformio.compat import string_types
from platformio.proc import get_pythonexe_path
from platformio.project.helpers import get_project_core_dir
LOG_FILE = None
@ -31,7 +30,7 @@ class BaseProcess(protocol.ProcessProtocol, object):
COMMON_PATTERNS = {
"PLATFORMIO_HOME_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):