init_env.bat 795 B

12345678910111213141516171819202122232425262728
  1. @echo OFF
  2. echo "Setting up enviromental Variables"
  3. rem check script execution directory vs script directory.
  4. IF "%cd%\"=="%~dp0" (
  5. GOTO exitnodir
  6. )
  7. rem setup relative paths from root folder
  8. set "TAURI_DIST_DIR=%~1tauri\examples\communication\dist"
  9. set "TAURI_DIR=%~1tauri\examples\communication\src-tauri"
  10. rem convert relative path to absolute path and re-set it into the enviroment var
  11. for /F "delims=" %%F IN ("%TAURI_DIST_DIR%") DO SET "TAURI_DIST_DIR=%%~fF"
  12. for /F "delims=" %%F IN ("%TAURI_DIR%") DO SET "TAURI_DIR=%%~fF"
  13. if NOT EXIST %TAURI_DIR% GOTO exitnodir
  14. if NOT EXIST %TAURI_DIST_DIR% GOTO exitnodir
  15. GOTO exitfine
  16. :exitnodir
  17. echo "Variables are not setup properly. Please run from Tauri Root directory"
  18. @EXIT /B 1
  19. :exitfine
  20. echo "Variables set, ready to work!"
  21. @EXIT /B 0