Merge pull request #175 from pohgxz/main

修复Way05无法带参
This commit is contained in:
手瓜一十雪
2024-07-30 09:12:15 +08:00
committed by GitHub
2 changed files with 18 additions and 5 deletions

View File

@@ -45,7 +45,14 @@ $jsCode | Out-File -FilePath $jsFilePath -Encoding UTF8
Write-Output "JavaScript code has been generated and saved to $jsFilePath" Write-Output "JavaScript code has been generated and saved to $jsFilePath"
# 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址 # 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址
$env:NAPCAT_PATH = $jsFilePath $env:NAPCAT_PATH = $jsFilePath
for ($i = 0; $i -lt $args.Length; $i++) {
$param = $args[$i]
if ($args[$i] -eq "-q" -and $i + 1 -lt $args.Length) {
$nextParam = $args[$i + 1]
$params = "$param $nextParam"
break
}
}
Try { Try {
$QQpath = Get-QQpath $QQpath = Get-QQpath
} }
@@ -57,4 +64,4 @@ Catch {
} }
$commandInfo = Get-Command $QQpath -ErrorAction Stop $commandInfo = Get-Command $QQpath -ErrorAction Stop
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& chcp 65001;& '$($commandInfo.Path)' --enable-logging }" Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& chcp 65001;& '$($commandInfo.Path)' --enable-logging $params}"

View File

@@ -45,8 +45,14 @@ $jsCode | Out-File -FilePath $jsFilePath -Encoding UTF8
Write-Output "JavaScript code has been generated and saved to $jsFilePath" Write-Output "JavaScript code has been generated and saved to $jsFilePath"
# 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址 # 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址
$env:NAPCAT_PATH = $jsFilePath $env:NAPCAT_PATH = $jsFilePath
for ($i = 0; $i -lt $args.Length; $i++) {
$params = $args -join " " $param = $args[$i]
if ($args[$i] -eq "-q" -and $i + 1 -lt $args.Length) {
$nextParam = $args[$i + 1]
$params = "$param $nextParam"
break
}
}
Try { Try {
$QQpath = Get-QQpath $QQpath = Get-QQpath
} }