2019-12-31 01:26:14 +03:00
|
|
|
#!/usr/bin/env sh
|
2019-12-29 08:45:13 +03:00
|
|
|
# Note: Script must be run like this `. .init_env.sh` to setup variables for your current shell
|
|
|
|
# define relative paths
|
|
|
|
|
2020-03-09 09:26:07 +03:00
|
|
|
DistPath='tauri/examples/communication/dist'
|
|
|
|
SrcPath='tauri/examples/communication/src-tauri'
|
2019-12-29 08:45:13 +03:00
|
|
|
|
2019-12-31 01:26:14 +03:00
|
|
|
echo "Setting up enviroment Variables"
|
2019-12-29 08:45:13 +03:00
|
|
|
|
|
|
|
# check if relative paths exist
|
2019-12-31 01:26:14 +03:00
|
|
|
if [ -d "${DistPath}" ]||[ -d "${SrcPath}" ]
|
2019-12-29 08:45:13 +03:00
|
|
|
then
|
|
|
|
# Convert to absolute paths
|
2019-12-31 01:26:14 +03:00
|
|
|
DistPath="$(cd "${DistPath}" && pwd -P)"
|
|
|
|
SrcPath="$(cd "${SrcPath}" && pwd -P)"
|
2019-12-29 08:45:13 +03:00
|
|
|
|
|
|
|
# export enviromental variables
|
2019-12-31 01:26:14 +03:00
|
|
|
export TAURI_DIST_DIR=${DistPath}
|
|
|
|
export TAURI_DIR=${SrcPath}
|
2019-12-29 08:45:13 +03:00
|
|
|
echo "Variables set, ready to work!"
|
|
|
|
|
|
|
|
else
|
|
|
|
# if directories don't exist then exit script and tell user run script in root dir.
|
|
|
|
echo "Error: Variables are not setup properly. Please run from Tauri Root directory '. .scripts/init_env.sh'"
|
|
|
|
fi
|