build.ps1 867 B

123456789101112131415161718192021222324
  1. function Get-LatestDirectory {
  2. param (
  3. $Path
  4. )
  5. Get-ChildItem -Path $Path | Where-Object {$_.PSIsContainer} | Sort-Object LastWriteTime -Descending | Select-Object -First 1
  6. }
  7. ./fbt u COMPACT=1 DEBUG=0 VERBOSE=0 fap_totp
  8. ./fbt o COMPACT=1 DEBUG=0 VERBOSE=0 fap_totp
  9. Push-Location $PSScriptRoot
  10. if (!(Test-Path -PathType Container "build")) {
  11. New-Item -ItemType Directory -Path "build"
  12. }
  13. $official_latest_dir = Get-LatestDirectory -Path "flipperzero-firmware_official\build\"
  14. Copy-Item "flipperzero-firmware_official\build\$official_latest_dir\.extapps\totp.fap" -Destination "build\totp_official-fw.fap"
  15. $unleashed_latest_dir = Get-LatestDirectory -Path "flipperzero-firmware_unleashed\build\"
  16. Copy-Item "flipperzero-firmware_unleashed\build\$unleashed_latest_dir\.extapps\totp.fap" -Destination "build\totp_unleashed-fw.fap"
  17. Pop-Location