fbt.ps1 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. Push-Location $PSScriptRoot
  2. $firmware_path = ""
  3. $firmware_name = ""
  4. if (('official-dev', 'off-dev', 'od', 'unleashed', 'un', 'u').Contains($args[0])) {
  5. $firmware_path = "flipperzero-firmware_official_dev"
  6. $firmware_name = "Official Dev"
  7. }
  8. elseif (('official-stable', 'off-stbl', 'os').Contains($args[0])) {
  9. $firmware_path = "flipperzero-firmware_official_stable"
  10. $firmware_name = "Official Stable"
  11. } elseif (('xtreme', 'xt', 'x').Contains($args[0])) {
  12. $firmware_path = "flipperzero-firmware_xtreme"
  13. $firmware_name = "Xtreme"
  14. }
  15. else {
  16. throw "Unable to recognize which firmware to use"
  17. }
  18. Write-Host "Using $firmware_name firmware to run FBT"
  19. $commandline_scons = "$firmware_path\site_scons\commandline.scons"
  20. ((Get-Content -Path $commandline_scons -Raw) -replace 'applications_user','..') | Set-Content -Path $commandline_scons -NoNewline
  21. $builtin_totp_path = "$firmware_path\applications\external\totp"
  22. if ((Test-Path -Path $builtin_totp_path) -eq $True) {
  23. Remove-Item $builtin_totp_path -Recurse
  24. }
  25. Push-Location $firmware_path
  26. ./fbt $args[1..($args.Length - 1)]
  27. Pop-Location
  28. Pop-Location