aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTsuyoshi CHO <Tsuyoshi.CHO@Gmail.com>2019-12-29 11:34:06 +0900
committerTsuyoshi CHO <Tsuyoshi.CHO@Gmail.com>2019-12-29 11:34:06 +0900
commit03a6c769e2413c4cac3aa6bb5d707da934e1bc04 (patch)
tree205fde63cd9c3a6b926aaf8b3a307d8c41112790
parenta0865ce2089cfb3248d850e0d24a26855f03da6b (diff)
downloadvim-lsp-settings-03a6c769e2413c4cac3aa6bb5d707da934e1bc04.tar.gz
vim-lsp-settings-03a6c769e2413c4cac3aa6bb5d707da934e1bc04.tar.bz2
vim-lsp-settings-03a6c769e2413c4cac3aa6bb5d707da934e1bc04.zip
python check,pip check,venv verification
-rw-r--r--installer/pip_install.cmd36
1 files changed, 24 insertions, 12 deletions
diff --git a/installer/pip_install.cmd b/installer/pip_install.cmd
index c551b7b..017a478 100644
--- a/installer/pip_install.cmd
+++ b/installer/pip_install.cmd
@@ -8,6 +8,7 @@ rd /Q /S "%server_dir%" 2>NUL
md "%server_dir%"
cd "%server_dir%"
+REM python(ver 3.x) or python3 check
where python && goto :python
:python_fail
where python3 && goto :python3
@@ -15,29 +16,40 @@ where python3 && goto :python3
goto :EOF
:python
+REM python is 2 or 3 check(python3 version at python3 grammar)
python -c "import sys; from distutils.version import LooseVersion;sys.exit(0 if (LooseVersion(sys.version) > LooseVersion('3')) else 1)"
if errorlevel 1 goto :python_fail
+REM python support slash path split?
python -m venv ./venv
-venv\Scripts\pip3 install %2
+if not errorlevel 1 goto :install
+python -m venv .\venv
+goto :install
-echo @echo off ^
+:python3
+REM python3 always python 3.x :-)
+REM python3 -c "import sys; from distutils.version import LooseVersion;sys.exit(0 if (LooseVersion(sys.version) > LooseVersion('3')) else 1)"
+REM if errorlevel 1 goto :python3_fail
-%%~dp0\venv\Scripts\%1.exe %%* ^
+REM python3 support slash path split?
+python3 -m venv ./venv
+if not errorlevel 1 goto :install
+python3 -m venv .\venv
+goto :install
-> %1.cmd
-goto :EOF
+:install
-:python3
-python3 -c "import sys; from distutils.version import LooseVersion;sys.exit(0 if (LooseVersion(sys.version) > LooseVersion('3')) else 1)"
-if errorlevel 1 goto :python3_fail
+REM 1. pip command path check
+where venv\bin\pip3 && set PIPPATH=venv\bin && goto :generate
+where venv\Scripts\pip3 && set PIPPATH=venv\Scripts && goto :generate
+goto :EOF
-python3 -m venv ./venv
-venv\bin\pip3 install %2
+REM 2. pyls exec cmd generate
+:generate
+%PIPPATH%\pip3 install %2
echo @echo off ^
-%%~dp0\venv\bin\%1.cmd %%* ^
+%%~dp0\%PIPPATH%\%1 %%* ^
> %1.cmd
-goto :EOF