forked from iNavFlight/inav
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shF4.cmd
98 lines (77 loc) · 2.64 KB
/
shF4.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
97
98
pause
wait
rem
rem Based on the msys.bat file from the MSYS package
rem http://www.mingw.org/wiki/msys
rem
rem Shared directories for toolchains
set TOOLS_DIR=C:/devtools
rem this should let run MSYS shell on x64
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
SET COMSPEC=%WINDIR%\SysWOW64\cmd.exe
)
rem some MSYS environment variables
if "x%MSYSTEM%" == "x" set MSYSTEM=MINGW32
if not "x%DISPLAY%" == "x" set DISPLAY=
set NOT_FOUND=
set PATH_DIRS=%TOOLS_DIR%\bin;%TOOLS_DIR%\gcc-arm-none-eabi-6-2017-q2-update\bin;%TOOLS_DIR%\eclipse;c:\ProgramData\Oracle\Java\javapath;C:\Ruby25-x64\bin
set MAKE_COMMAND=
call :which MSYSGIT "C:\Git\bin" git.exe
if "%NOT_FOUND%" == "" goto set_path
echo:
echo Some tools were not found in the PATH or expected location:
for %%f in (%NOT_FOUND%) do echo %%f
echo You may want to install them and/or update paths in the %0 file.
echo:
rem --------------------------------------------------------------------------
rem Provide a clean environment for command line build. We remove the
rem msysGit cmd subdirectory as well, so no recursive sh call can occur.
rem --------------------------------------------------------------------------
:set_path
set PATH=%SYSTEMROOT%\system32;%SYSTEMROOT%
set PATH=%PATH_DIRS%;%PATH%
rem echo PATH: %PATH%
rem --------------------------------------------------------------------------
rem Start a shell.
rem Any shell script can be passed to it via command line of this batch file.
rem --------------------------------------------------------------------------
if not exist "%MSYSGIT%\bash.exe" goto no_bash
call "%MSYSGIT%\bash.exe" --login -i %*
goto :eof
:no_bash
echo Cannot find bash, exiting with error
pause
rem exit 1
rem --------------------------------------------------------------------------
rem Attempt to find executable in the directory given or in the PATH
rem --------------------------------------------------------------------------
:which
rem search in the directory given first
for %%F in (%2) do set FP=%%~F\%3
if exist "%FP%" goto found_directly
rem search in the PATH last
for %%F in (%3) do set FP=%%~$PATH:F
if exist "%FP%" goto found_in_path
:not_found
for %%F in (%2) do set FP=%%~F
rem echo %3: not found, expected in %FP%
set FP=
set NOT_FOUND=%NOT_FOUND% %3
goto set
:found_directly
for %%F in ("%FP%") do set FP=%%~dpsF
rem echo %3: found at: %FP%
goto set
:found_in_path
for %%F in ("%FP%") do set FP=%%~dpsF
rem echo %3: found in the PATH: %FP%
:set
rem set results regardless of was it found or not
set %1=%FP%
rem echo %1=%FP%
if "%FP%" == "" goto :eof
if not "%PATH_DIRS%" == "" set PATH_DIRS=%PATH_DIRS%;
set PATH_DIRS=%PATH_DIRS%%FP%
goto :eof
pause
wait