@clazic/urban 0.2.16 → 0.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clazic/urban",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "description": "도시계획연구 보고서 자동 수집·지식베이스 데몬",
5
5
  "type": "module",
6
6
  "engines": {
package/src/cli.js CHANGED
@@ -64,7 +64,7 @@ async function run() {
64
64
  console.log(`✅ ${installResult.message}`);
65
65
  }
66
66
  const result = await startDaemon();
67
- console.log(result.ok ? `✅ ${result.message}` : `❌ 데몬 시작 실패: ${result.message}`);
67
+ console.log(result.ok ? `✅ ${result.message}` : `❌ ${result.message}`);
68
68
  break;
69
69
  }
70
70
  case 'stop': {
@@ -105,7 +105,7 @@ $urbanHome = '${psQ(urbanHome)}'
105
105
  $argument = '-NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File "' + $scriptPath + '"'
106
106
  $action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument $argument -WorkingDirectory $urbanHome
107
107
  $trigger = New-ScheduledTaskTrigger -AtLogOn -User $env:USERNAME
108
- $principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -LogonType S4U -RunLevel Limited
108
+ $principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -LogonType Interactive -RunLevel Limited
109
109
  $settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit ([TimeSpan]::Zero) -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable -MultipleInstances IgnoreNew -RestartCount 5 -RestartInterval (New-TimeSpan -Minutes 1) -Hidden
110
110
  Unregister-ScheduledTask -TaskName 'Urban' -Confirm:$false -ErrorAction SilentlyContinue | Out-Null
111
111
  Register-ScheduledTask -TaskName 'Urban' -Action $action -Trigger $trigger -Principal $principal -Settings $settings | Out-Null
@@ -348,10 +348,11 @@ export async function statusDaemon() {
348
348
  }
349
349
  } else if (isWindows) {
350
350
  try {
351
- // -ErrorAction SilentlyContinue: 미등록 문자열 반환 (throw 없음)
351
+ // ?. 연산자는 PS 7+ 전용 PS 5.1(Windows 기본)에서 파싱 오류 발생
352
+ // if 분기로 대체: 미등록 시 빈 문자열 출력
352
353
  const result = execSync(
353
- `powershell -NoProfile -Command "(Get-ScheduledTask -TaskName 'Urban' -ErrorAction SilentlyContinue)?.State"`,
354
- { encoding: 'utf8', shell: true, stdio: 'pipe' }
354
+ `powershell -NoProfile -Command "$t = Get-ScheduledTask -TaskName 'Urban' -ErrorAction SilentlyContinue; if ($t) { $t.State } else { '' }"`,
355
+ { encoding: 'utf8', shell: true, stdio: ['ignore', 'pipe', 'pipe'] }
355
356
  );
356
357
  const state = result.trim();
357
358
  if (!state) return { running: false, message: '데몬 미등록' };