mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-31 10:58:06 +08:00
core: 修复 powershell 下无法正确传递 --image-name 参数
This commit is contained in:
parent
f34b199bd8
commit
c4c7c8e253
@ -79,15 +79,20 @@ if not exist reinstall.sh (
|
|||||||
call :download %confhome%/reinstall.sh %~dp0reinstall.sh
|
call :download %confhome%/reinstall.sh %~dp0reinstall.sh
|
||||||
)
|
)
|
||||||
|
|
||||||
:: 运行 reinstall.sh
|
:: 为每个参数添加引号,使参数正确传递到 bash
|
||||||
:: 方法1:
|
for %%a in (%*) do (
|
||||||
|
set "param=!param! "%%~a""
|
||||||
|
)
|
||||||
|
|
||||||
:: 在c盘根目录下执行 cygpath -ua . 会得到 /cygdrive/c,因此末尾要有 /
|
:: 在c盘根目录下执行 cygpath -ua . 会得到 /cygdrive/c,因此末尾要有 /
|
||||||
for /f %%a in ('%SystemDrive%\cygwin\bin\cygpath -ua ./') do set thisdir=%%a
|
for /f %%a in ('%SystemDrive%\cygwin\bin\cygpath -ua ./') do set thisdir=%%a
|
||||||
%SystemDrive%\cygwin\bin\bash -l -c "%thisdir%reinstall.sh %*"
|
|
||||||
|
|
||||||
:: 方法2:
|
:: 方法1
|
||||||
:: set PATH=/usr/local/bin:/usr/bin
|
%SystemDrive%\cygwin\bin\bash -l -c '%thisdir%reinstall.sh !param!'
|
||||||
|
|
||||||
|
:: 方法2
|
||||||
:: %SystemDrive%\cygwin\bin\bash reinstall.sh %*
|
:: %SystemDrive%\cygwin\bin\bash reinstall.sh %*
|
||||||
|
:: 再在 reinstall.sh 里运行 source /etc/profile
|
||||||
exit /b !errorlevel!
|
exit /b !errorlevel!
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user