init_env.sh 873 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env sh
  2. # Note: Script must be run like this `. .init_env.sh` to setup variables for your current shell
  3. # define relative paths
  4. DistPath='tauri/examples/communication/dist'
  5. SrcPath='tauri/examples/communication/src-tauri'
  6. echo "Setting up enviroment Variables"
  7. # check if relative paths exist
  8. if [ -d "${DistPath}" ]||[ -d "${SrcPath}" ]
  9. then
  10. # Convert to absolute paths
  11. DistPath="$(cd "${DistPath}" && pwd -P)"
  12. SrcPath="$(cd "${SrcPath}" && pwd -P)"
  13. # export enviromental variables
  14. export TAURI_DIST_DIR=${DistPath}
  15. export TAURI_DIR=${SrcPath}
  16. echo "Variables set, ready to work!"
  17. else
  18. # if directories don't exist then exit script and tell user run script in root dir.
  19. echo "Error: Variables are not setup properly. Please run from Tauri Root directory '. .scripts/init_env.sh'"
  20. fi