Compare commits

...

2 Commits

Author SHA1 Message Date
doylet
da11ede6a2 Add scripts folder 2023-08-17 12:00:40 +10:00
doylet
d044321ff0 Add env var for root of devenv 2023-08-17 12:00:40 +10:00
2 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1,12 @@
@echo off
setlocal
set desired_path=%devenver_root%\NodeJS\16.19.0
set desired_exe=yarn
set path=%desired_path%;%path%
set exe_to_use=""
for /f "delims=" %%a in ('where "$desired_path:%desired_exe%"') do ( set "exe_to_use=%%a")
echo [DEVENVER] Executing script "%~dpnx0" with "%exe_to_use%"
call %desired_exe% %*
endlocal

View File

@ -794,9 +794,16 @@ def run(user_app_list,
# Write the devenv script with environment variables
if is_windows:
devenv_script_buffer += "set PATH=%~dp0Symlinks;%PATH%\n"
devenv_script_buffer += "set devenver_root_backslash=%~dp0\n"
devenv_script_buffer += "set devenver_root=%devenver_root_backslash:~0,-1%\n"
devenv_script_buffer += "set devenver_root_backslash=\n"
devenv_script_buffer += "set path=%~dp0Symlinks;%PATH%\n"
devenv_script_buffer += "set path=%~dp0Scripts;%PATH%\n"
else:
devenv_script_buffer += f"PATH=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )/Symlinks\":$PATH\n"
devenv_script_buffer += f"devenver_root=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )\":$PATH\n"
devenv_script_buffer += f"path=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )/Scripts\":$PATH\n"
devenv_script_buffer += f"path=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )/Symlinks\":$PATH\n"
devenv_script_name = f"{devenv_script_name}.bat" if is_windows else f"{devenv_script_name}.sh"
devenv_script_path = pathlib.Path(install_dir, devenv_script_name)