Skip to content

Commit ea57ec9

Browse files
authored
fix: 跨平台 pnpm 调用兼容 + 清理无用开关 (#118)
1 parent 6a2fbac commit ea57ec9

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

scripts/action.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { spawn } from 'node:child_process'
2+
import { platform } from 'node:os'
23
import process from 'node:process'
34
import * as core from '@actions/core'
45
import waitOn from 'wait-on'
@@ -9,10 +10,10 @@ const BASE_URL = `http://${HOST}:${PORT}`
910

1011
core.info('🚀 准备启动 Nitro 服务...')
1112

12-
// 启动服务(shell: true 保证 Windows 下能找到 pnpm.cmd)
13-
const server = spawn('pnpm dev', {
13+
// Windows 下 pnpm 实际是 pnpm.cmd,需要指定完整文件名
14+
const pnpmCmd = platform() === 'win32' ? 'pnpm.cmd' : 'pnpm'
15+
const server = spawn(pnpmCmd, ['dev'], {
1416
stdio: 'inherit',
15-
shell: true,
1617
env: {
1718
...process.env,
1819
NITRO_PORT: String(PORT),

tasks/attendance.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ const attendanceContext = createContext<AttendanceContext>({
4949
// Export composable function for accessing context
5050
const useAttendanceContext = attendanceContext.use
5151

52-
// 是否启用终末地签到
53-
const ENDFIELD_ENABLED = true
54-
55-
const ATTENDANCE_AVAILABLE_APPCODE = ['arknights', ...(ENDFIELD_ENABLED ? ['endfield'] : [])]
52+
const ATTENDANCE_AVAILABLE_APPCODE = ['arknights', 'endfield']
5653

5754
async function processAccount(
5855
token: string,

0 commit comments

Comments
 (0)