aboutsummaryrefslogtreecommitdiffstats
path: root/ya.bat
diff options
context:
space:
mode:
authordvshkurko <dvshkurko@yandex-team.ru>2022-02-10 16:45:51 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:51 +0300
commit321ee9bce31ec6e238be26dbcbe539cffa2c3309 (patch)
tree14407a2757cbf29eb97e266b7f07e851f971000c /ya.bat
parent2f6ca198245aeffd5e2d82b65927c2465b68b4f5 (diff)
downloadydb-321ee9bce31ec6e238be26dbcbe539cffa2c3309.tar.gz
Restoring authorship annotation for <dvshkurko@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'ya.bat')
-rwxr-xr-xya.bat172
1 files changed, 86 insertions, 86 deletions
diff --git a/ya.bat b/ya.bat
index 4e897c1045..16e773382e 100755
--- a/ya.bat
+++ b/ya.bat
@@ -1,86 +1,86 @@
-@echo off
-rem Ya Simple Windows launcher
-setlocal
-call :dbg Ya Simple Windows Launcher (Debug)
-call :find_ya
-if ERRORLEVEL 1 exit /b 1
-call :dbg Ya: %YA_BAT_REAL%
-call :fix_env
-call :find_python
-if ERRORLEVEL 1 exit /b 1
-call :dbg Python: "%YA_BAT_PYTHON%"
-call "%YA_BAT_PYTHON%" "%YA_BAT_REAL%" %*
-exit /b %ERRORLEVEL%
-
-:find_ya
-call :dbg Searching for ya near ya.bat...
-set YA_BAT_REAL=%~dp0ya
-if exist "%YA_BAT_REAL%" exit /b 0
-call :err Ya not found
-exit /b 1
-
-:fix_env
-call :dbg Fixing environment...
-for /f "delims=: tokens=2" %%F in ('chcp') do (
- if "%%F" == " 65001" (
- call :dbg -- Forcing I/O encoding for python: utf-8
- set PYTHONIOENCODING=utf-8
- )
-)
-exit /b 0
-
-:find_python
-call :dbg Searching for python in PATH...
-for /f "delims=" %%F in ('where python 2^>nul') do (
- call :test_python %%~sF
- if not ERRORLEVEL 1 (
- set YA_BAT_PYTHON=%%F
- exit /b 0
- )
-)
-call :dbg Searching for python in ftypes...
-for /f delims^=^=^"^ tokens^=2 %%F in ('ftype Python.File 2^>nul') do (
- call :test_python %%F
- if not ERRORLEVEL 1 (
- set YA_BAT_PYTHON=%%F
- exit /b 0
- )
-)
-call :dbg Searching for python manually...
-for %%F in (
- C:\Python27\python.exe
- C:\Python26\python.exe
-) do (
- call :test_python %%F
- if not ERRORLEVEL 1 (
- set YA_BAT_PYTHON=%%F
- exit /b 0
- )
-)
-call :err Python not found
-exit /b 1
-
-:test_python
-call :dbg -- Checking python: %1
-if not exist %1 (
- call :dbg ---- Not found
- exit /b 1
-)
-for /f %%P in ('%1 -c "import os, sys; sys.stdout.write(os.name + '\n')" 2^>nul') do set YA_BAT_PYTHON_PLATFORM=%%P
-if not defined YA_BAT_PYTHON_PLATFORM (
- call :dbg ---- Not runnable
- exit /b 2
-)
-if not "%YA_BAT_PYTHON_PLATFORM%"=="nt" (
- call :dbg ---- Non-windows: %YA_BAT_PYTHON_PLATFORM%
- exit /b 3
-)
-exit /b 0
-
-:dbg
-if defined YA_BAT_DEBUG echo [ya.bat] %* 1>&2
-exit /b 0
-
-:err
-echo [ya.bat] Error: %* 1>&2
-exit /b 0
+@echo off
+rem Ya Simple Windows launcher
+setlocal
+call :dbg Ya Simple Windows Launcher (Debug)
+call :find_ya
+if ERRORLEVEL 1 exit /b 1
+call :dbg Ya: %YA_BAT_REAL%
+call :fix_env
+call :find_python
+if ERRORLEVEL 1 exit /b 1
+call :dbg Python: "%YA_BAT_PYTHON%"
+call "%YA_BAT_PYTHON%" "%YA_BAT_REAL%" %*
+exit /b %ERRORLEVEL%
+
+:find_ya
+call :dbg Searching for ya near ya.bat...
+set YA_BAT_REAL=%~dp0ya
+if exist "%YA_BAT_REAL%" exit /b 0
+call :err Ya not found
+exit /b 1
+
+:fix_env
+call :dbg Fixing environment...
+for /f "delims=: tokens=2" %%F in ('chcp') do (
+ if "%%F" == " 65001" (
+ call :dbg -- Forcing I/O encoding for python: utf-8
+ set PYTHONIOENCODING=utf-8
+ )
+)
+exit /b 0
+
+:find_python
+call :dbg Searching for python in PATH...
+for /f "delims=" %%F in ('where python 2^>nul') do (
+ call :test_python %%~sF
+ if not ERRORLEVEL 1 (
+ set YA_BAT_PYTHON=%%F
+ exit /b 0
+ )
+)
+call :dbg Searching for python in ftypes...
+for /f delims^=^=^"^ tokens^=2 %%F in ('ftype Python.File 2^>nul') do (
+ call :test_python %%F
+ if not ERRORLEVEL 1 (
+ set YA_BAT_PYTHON=%%F
+ exit /b 0
+ )
+)
+call :dbg Searching for python manually...
+for %%F in (
+ C:\Python27\python.exe
+ C:\Python26\python.exe
+) do (
+ call :test_python %%F
+ if not ERRORLEVEL 1 (
+ set YA_BAT_PYTHON=%%F
+ exit /b 0
+ )
+)
+call :err Python not found
+exit /b 1
+
+:test_python
+call :dbg -- Checking python: %1
+if not exist %1 (
+ call :dbg ---- Not found
+ exit /b 1
+)
+for /f %%P in ('%1 -c "import os, sys; sys.stdout.write(os.name + '\n')" 2^>nul') do set YA_BAT_PYTHON_PLATFORM=%%P
+if not defined YA_BAT_PYTHON_PLATFORM (
+ call :dbg ---- Not runnable
+ exit /b 2
+)
+if not "%YA_BAT_PYTHON_PLATFORM%"=="nt" (
+ call :dbg ---- Non-windows: %YA_BAT_PYTHON_PLATFORM%
+ exit /b 3
+)
+exit /b 0
+
+:dbg
+if defined YA_BAT_DEBUG echo [ya.bat] %* 1>&2
+exit /b 0
+
+:err
+echo [ya.bat] Error: %* 1>&2
+exit /b 0