fbt.ps1 1.1 KB

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