Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into release-candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
hedger committed May 22, 2023
2 parents 72ceb92 + a396ec8 commit a2af281
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions ufbt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def ufbt_cli():
if any(map(sys.argv.__contains__, bootstrap_subcommands)):
return bootstrap_cli()

if not os.path.exists(ufbt_state_dir):
bootstrap_cli()
if not os.path.exists(ufbt_state_dir / "current"):
bootstrap_cli(["update"])

if not (ufbt_state_dir / "current" / "scripts" / "ufbt").exists():
print("SDK is missing scripts distribution!")
Expand All @@ -62,19 +62,17 @@ 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 '
"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:])
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 '
"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:])
f'"UFBT_APP_DIR={UFBT_APP_DIR}" ' + " ".join(sys.argv[1:])
)

# print(commandline)
Expand Down
4 changes: 2 additions & 2 deletions ufbt/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ def _func(self, args) -> int:
)


def bootstrap_cli() -> Optional[int]:
def bootstrap_cli(cmdline_args=None) -> Optional[int]:
logging.basicConfig(
format="%(asctime)s.%(msecs)03d [%(levelname).1s] %(message)s",
level=logging.INFO,
Expand Down Expand Up @@ -775,7 +775,7 @@ def bootstrap_cli() -> Optional[int]:
for subcommand_cls in bootstrap_subcommand_classes:
subcommand_cls().add_to_parser(parsers)

args = root_parser.parse_args()
args = root_parser.parse_args(cmdline_args)
if args.verbose:
logging.getLogger().setLevel(logging.DEBUG)

Expand Down

0 comments on commit a2af281

Please sign in to comment.