generate_freezed.cmd 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. @echo off
  2. REM Store the current working directory
  3. set "original_dir=%CD%"
  4. REM Change the current working directory to the script's location
  5. cd /d "%~dp0"
  6. REM Navigate to the project root
  7. cd ..\..\..\appflowy_flutter
  8. REM Navigate to the appflowy_flutter directory and generate files
  9. echo Generating files for appflowy_flutter
  10. call flutter clean >nul 2>&1 && call flutter packages pub get >nul 2>&1 && call dart run build_runner clean && call dart run build_runner build -d
  11. echo Done generating files for appflowy_flutter
  12. echo Generating files for packages
  13. cd packages
  14. for /D %%d in (*) do (
  15. REM Navigate into the subdirectory
  16. cd "%%d"
  17. REM Check if the subdirectory contains a pubspec.yaml file
  18. if exist "pubspec.yaml" (
  19. echo Generating freezed files in %%d...
  20. echo Please wait while we clean the project and fetch the dependencies.
  21. call flutter clean >nul 2>&1 && call flutter packages pub get >nul 2>&1 && call dart run build_runner clean && call dart run build_runner build -d
  22. echo Done running build command in %%d
  23. ) else (
  24. echo No pubspec.yaml found in %%d, it can't be a Dart project. Skipping.
  25. )
  26. REM Navigate back to the packages directory
  27. cd ..
  28. )
  29. REM Return to the original directory
  30. cd /d "%original_dir%"