Last active
August 15, 2016 07:55
-
-
Save shengyou/523900a9c3a0b6dbdd4bcc6d40df6373 to your computer and use it in GitHub Desktop.
Windows 平台下用 cmd.exe 偵測作業系統版本。(用於 wagon 裡依作業系統版本動態載入不同 PHP 版本)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@for /f "tokens=2 delims=[]" %%G in ('ver') do @set _version=%%G | |
@for /f "tokens=2,3,4 delims=. " %%G in ('echo %_version%') do @set _major=%%G& @set _minor=%%H& @set _build=%%I | |
@if "%_major%"=="10" ( | |
set PHP_INSTSLL_ROOT=%WAGON_ROOT%\uwamp\bin\php\php-7.0.3 | |
) else ( | |
set PHP_INSTSLL_ROOT=%WAGON_ROOT%\uwamp\bin\php\php-5.6.18 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment