fbt.ps1 913 B

1234567891011121314151617181920212223242526272829303132
  1. Push-Location $PSScriptRoot
  2. $firmware_path = ""
  3. $firmware_name = ""
  4. if (('official', 'off', 'o').Contains($args[0])) {
  5. $firmware_path = "flipperzero-firmware_official"
  6. $firmware_name = "Official"
  7. }
  8. elseif (('unleashed', 'un', 'u').Contains($args[0])) {
  9. $firmware_path = "flipperzero-firmware_unleashed"
  10. $firmware_name = "Unleashed"
  11. }
  12. else {
  13. throw "Unable to recognize which firmware to use"
  14. }
  15. Write-Host "Using $firmware_name firmware to run FBT"
  16. $commandline_scons = "$firmware_path\site_scons\commandline.scons"
  17. ((Get-Content -Path $commandline_scons -Raw) -replace 'applications_user','..') | Set-Content -Path $commandline_scons
  18. $builtin_totp_path = "$firmware_path\applications\plugins\totp"
  19. if ((Test-Path -Path $builtin_totp_path) -eq $True) {
  20. Remove-Item $builtin_totp_path -Recurse
  21. }
  22. Push-Location $firmware_path
  23. ./fbt $args[1..($args.Length - 1)]
  24. Pop-Location
  25. Pop-Location