标签:ssi com tool github 添加 exec nal mnt sof
来自GitHub上的一个issue:Is it possible to use wsl bash php for php.validate.executablePath
d:\wsl-tools\php.bat
@echo OFF
setlocal ENABLEDELAYEDEXPANSION
rem Collect the arguments and replace:
rem '\' with '/'
rem 'd:' with 'mnt/d'
rem '"' with '\"'
set v_params=%*
set v_params=%v_params:\=/%
set v_params=%v_params:D:=/mnt/d%
set v_params=%v_params%
set v_params=%v_params:"=\"%
rem Call the windows-php inside WSL.
rem windows-php is just a script which passes the arguments onto
rem the original php executable and converts its output from UNIX
rem syntax to Windows syntax.
C:\Windows\system32\bash.exe -l -c "windows-php %v_params%"
/usr/local/bin/windows-php
#!/bin/bash
# Pass all the arguments to PHP.
output=$(php "$@")
# Perform UNIX->WINDOWS syntax replacements.
output="${output//$'\n'/$'\r'$'\n'}"
output="${output//\/mnt\/d/D:}"
output="${output//\//\\}"
# Echo corrected output.
echo $output
tips:记得添加执行权限
setting:
"php.validate.executablePath": "d:\\wsl-tools\\php.bat"
标签:ssi com tool github 添加 exec nal mnt sof
原文地址:https://www.cnblogs.com/alanabc/p/10727285.html