diff --git a/VERSION.txt b/VERSION.txt index 3a4036f..53a75d6 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.2.5 +0.2.6 diff --git a/pyproject.toml b/pyproject.toml index 8c56ea8..b9d16ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ authors = [{ name = "Flipper Devices Inc.", email = "pypi@flipperdevices.com" }] description = "uFBT - micro Flipper Build Tool. Tool for building and developing applications (.fap) for Flipper Zero and its device family." readme = "README.md" requires-python = ">=3.8" +dependencies = ["oslex>=0.1.3"] keywords = ["ufbt", "flipperzero", "fbt", "stm32", "fap"] license = { text = "GPL-3.0" } classifiers = [ @@ -26,7 +27,6 @@ classifiers = [ "Operating System :: POSIX :: Linux", ] - [project.urls] homepage = "https://github.com/flipperdevices/flipperzero-ufbt" documentation = "https://github.com/flipperdevices/flipperzero-ufbt" diff --git a/ufbt/__init__.py b/ufbt/__init__.py index f066a2e..3ed8187 100644 --- a/ufbt/__init__.py +++ b/ufbt/__init__.py @@ -21,6 +21,7 @@ import pathlib import platform import sys +import oslex from .bootstrap import ( DEFAULT_UFBT_HOME, @@ -83,10 +84,13 @@ def ufbt_cli(): if not os.path.exists(ufbt_state_dir / "current"): bootstrap_cli(["update"]) - if not (ufbt_state_dir / "current" / "scripts" / "ufbt").exists(): + if not ( + ufbt_script_root := ufbt_state_dir / "current" / "scripts" / "ufbt" + ).exists(): print("SDK is missing scripts distribution!") print("You might be trying to use an SDK in an outdated format.") - print("Run `ufbt update -h` for more information on how to update.") + print("You can clean up current state with `ufbt clean --purge`.") + print("Run `ufbt update -h` for more information on SDK installation.") return 1 UFBT_APP_DIR = os.getcwd() @@ -94,18 +98,23 @@ def ufbt_cli(): if platform.system() == "Windows": commandline = ( r'call "%UFBT_STATE_DIR%/current/scripts/toolchain/fbtenv.cmd" env & ' - "python -m SCons -Q --warn=target-not-built " - r'-C "%UFBT_STATE_DIR%/current/scripts/ufbt" ' - f'"UFBT_APP_DIR={UFBT_APP_DIR}" ' + " ".join(sys.argv[1:]) ) - else: - commandline = ( - '. "$UFBT_STATE_DIR/current/scripts/toolchain/fbtenv.sh" && ' - "python3 -m SCons -Q --warn=target-not-built " - '-C "$UFBT_STATE_DIR/current/scripts/ufbt" ' - f'"UFBT_APP_DIR={UFBT_APP_DIR}" ' + " ".join(sys.argv[1:]) - ) + commandline = '. "$UFBT_STATE_DIR/current/scripts/toolchain/fbtenv.sh" && ' + + commandline += oslex.join( + [ + "python3", + "-m", + "SCons", + "-Q", + "--warn=target-not-built", + "-C", + str(ufbt_script_root), + f"UFBT_APP_DIR={UFBT_APP_DIR}", + *sys.argv[1:], + ] + ) # print(commandline) retcode = os.system(commandline)