tauri/.scripts/init_env.bat
Tensor-Programming 4e76f42d8a
feat(core) add cargo examples (#499)
* add cargo example

* change name to communication

* update scripts to set environment vars for example

* remove build key
2020-03-09 02:26:07 -04:00

28 lines
795 B
Batchfile

@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
set "TAURI_DIST_DIR=%~1tauri\examples\communication\dist"
set "TAURI_DIR=%~1tauri\examples\communication\src-tauri"
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