-
Notifications
You must be signed in to change notification settings - Fork 0
/
console.cmd
96 lines (68 loc) · 2.7 KB
/
console.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@echo off
chcp 65001>nul
setlocal EnableExtensions EnableDelayedExpansion
if not exist "C:\Program Files (x86)" (
echo.^(x^) Processor architecture %processor_architecture% is not supported
exit /b
)
pushd "%~dp0"
set $FALSE=0
set $TRUE=1
set $PROPS=console.properties
title Project Command Prompt v1.3
cls
rem Read custom console properties if available
for /f "delims=" %%i in ('type "%$PROPS%" 2^>nul') do call set %%i
rem Ensure engine root is specified
if not exist "%$ENGINE_ROOT%" (
echo.^(x^) Engine root not found
echo. Use %$PROPS% to set the root dir as follows: $ENGINE_ROOT=[path]
exit /b
)
rem Apply wildcard* transformations
for /d %%i in ("%$ENGINE_ROOT%") do set $ENGINE_ROOT=%%~fi
rem Get the engine console path
for %%i in ("%$ENGINE_ROOT%\*win64_console.exe") do set $ENGINE_CONSOLE=%%~nxi
rem Append engine root to the path
path %$ENGINE_ROOT%;%PATH%
rem Check native VCS availability
git>nul 2>nul
if !errorLevel! == 9009 (
set isGitAvailable=%$FALSE%
) else set isGitAvailable=%$TRUE%
rem Append VCS root to the path
rem Must not include brackets
if "%isGitAvailable%" == "%$FALSE%" if exist "%$VCS_ROOT%" path %$VCS_ROOT%;%PATH%
rem Check VCS availability again
git>nul 2>nul
if !errorLevel! == 9009 (
set isGitAvailable=%$FALSE%
) else set isGitAvailable=%$TRUE%
rem Setup custom command shortcuts
doskey plug="%$ENGINE_CONSOLE%" --headless -s plug.gd $*
doskey editor="%$ENGINE_CONSOLE%" -e $*
doskey editor-opengl3="%$ENGINE_CONSOLE%" -e --rendering-driver opengl3 $*
doskey game="%$ENGINE_CONSOLE%" $*
doskey game-opengl3="%$ENGINE_CONSOLE%" --rendering-driver opengl3 $*
echo.^(i^) Welcome to the Project Command Prompt
echo. Here's a quick help below to help you out
echo.
if "%isGitAvailable%" == "%$TRUE%" (
echo. git access the VCS
echo. git branch --all show all local and remote branches
echo. git switch -c demo origin/demo create and switch to a specific remote branch
echo. git fetch fetch updates
echo. git pull update current branch
echo.
echo. plug access plugin manager
echo. plug install install dependencies
echo. plug uninstall uninstall dependencies
echo.
)
echo. editor open the project in the editor
echo. editor-opengl3 open the project in the editor with OpenGL ES 3 support
echo.
echo. game run the game
echo. game-opengl3 run the game with OpenGL ES 3 support
echo.
cmd /k "prompt projectCMD ^> "