flipperdevices / flipperzero-ufbt

Compact tool for building and debugging applications for Flipper Zero.
https://pypi.org/project/ufbt/
GNU General Public License v3.0
494 stars 36 forks source link

Status commands write to stderr on non-zero return #27

Closed Nitepone closed 7 months ago

Nitepone commented 7 months ago

Currently, calling sub commands of ufbt status will suppress logging of the "error" value.

$> ufbt status
13:40:00.312 [I] uFBT version    0.2.4.3
13:40:00.312 [I] State dir       /home/luna/.ufbt
13:40:00.312 [I] Download dir    /home/luna/.ufbt/download
13:40:00.312 [I] SDK dir         /home/luna/.ufbt/current
13:40:00.312 [I] Toolchain dir   /home/luna/.ufbt/toolchain
13:40:00.312 [I] Error           SDK is not deployed
$> ufbt status sdk_dir
/home/luna/.ufbt/current
$> echo $?
1

With this change, whenever ufbt status returns non zero due to an "error" being set, it will also log the error to stderr.

$> python3 flipperzero-ufbt/ufbt/bootstrap.py status sdk_dir
/home/luna/.ufbt/current
13:42:30.151 [E] Status error: SDK is not deployed