Merge pull request #175 from pohgxz/main

修复Way05无法带参
This commit is contained in:
手瓜一十雪 2024-07-30 09:12:15 +08:00 committed by GitHub
commit a379ffd0f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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"
# 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址
$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 {
$QQpath = Get-QQpath
}
@ -57,4 +64,4 @@ Catch {
}
$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"
# 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址
$env:NAPCAT_PATH = $jsFilePath
$params = $args -join " "
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 {
$QQpath = Get-QQpath
}
@ -58,4 +64,4 @@ Catch {
}
$commandInfo = Get-Command $QQpath -ErrorAction Stop
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& '$($commandInfo.Path)' --enable-logging $params}"
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& '$($commandInfo.Path)' --enable-logging $params}"