2019-12-29 08:45:13 +03:00
|
|
|
@echo OFF
|
|
|
|
echo "Setting up enviromental Variables"
|
|
|
|
|
|
|
|
rem check script execution directory vs script directory.
|
|
|
|
|
|
|
|
IF "%cd%\"=="%~dp0" (
|
|
|
|
GOTO exitnodir
|
|
|
|
)
|
|
|
|
|
|
|
|
rem setup relative paths from root folder
|
2020-03-09 09:26:07 +03:00
|
|
|
set "TAURI_DIST_DIR=%~1tauri\examples\communication\dist"
|
|
|
|
set "TAURI_DIR=%~1tauri\examples\communication\src-tauri"
|
2019-12-29 08:45:13 +03:00
|
|
|
rem convert relative path to absolute path and re-set it into the enviroment var
|
|
|
|
for /F "delims=" %%F IN ("%TAURI_DIST_DIR%") DO SET "TAURI_DIST_DIR=%%~fF"
|
|
|
|
for /F "delims=" %%F IN ("%TAURI_DIR%") DO SET "TAURI_DIR=%%~fF"
|
|
|
|
|
|
|
|
if NOT EXIST %TAURI_DIR% GOTO exitnodir
|
|
|
|
if NOT EXIST %TAURI_DIST_DIR% GOTO exitnodir
|
|
|
|
|
|
|
|
GOTO exitfine
|
|
|
|
|
|
|
|
:exitnodir
|
|
|
|
echo "Variables are not setup properly. Please run from Tauri Root directory"
|
|
|
|
@EXIT /B 1
|
|
|
|
|
|
|
|
:exitfine
|
|
|
|
echo "Variables set, ready to work!"
|
|
|
|
@EXIT /B 0
|