@clazic/urban 0.2.11 → 0.2.13
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 +1 -1
- package/src/cli.js +7 -8
- package/src/install/daemon.js +6 -1
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -51,20 +51,19 @@ async function run() {
|
|
|
51
51
|
break;
|
|
52
52
|
}
|
|
53
53
|
case 'start': {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
// 등록 여부 먼저 확인 — 미등록이면 install 후 시작
|
|
55
|
+
const statusCheck = await statusDaemon();
|
|
56
|
+
if (statusCheck.message === '데몬 미등록') {
|
|
57
57
|
console.log('데몬이 등록되지 않았습니다. 자동 등록을 시도합니다...');
|
|
58
58
|
const installResult = await installDaemon();
|
|
59
|
-
if (installResult.ok) {
|
|
60
|
-
console.log(`✅ ${installResult.message}`);
|
|
61
|
-
result = await startDaemon();
|
|
62
|
-
} else {
|
|
59
|
+
if (!installResult.ok) {
|
|
63
60
|
console.log(`❌ 등록 실패: ${installResult.message}`);
|
|
64
|
-
console.log(
|
|
61
|
+
console.log(' 수동 등록: urban install && urban start');
|
|
65
62
|
break;
|
|
66
63
|
}
|
|
64
|
+
console.log(`✅ ${installResult.message}`);
|
|
67
65
|
}
|
|
66
|
+
const result = await startDaemon();
|
|
68
67
|
console.log(result.ok ? `✅ ${result.message}` : `❌ 데몬 시작 실패: ${result.message}`);
|
|
69
68
|
break;
|
|
70
69
|
}
|
package/src/install/daemon.js
CHANGED
|
@@ -312,8 +312,13 @@ export async function statusDaemon() {
|
|
|
312
312
|
}
|
|
313
313
|
} else if (isWindows) {
|
|
314
314
|
try {
|
|
315
|
-
|
|
315
|
+
// -ErrorAction SilentlyContinue: 미등록 시 빈 문자열 반환 (throw 없음)
|
|
316
|
+
const result = execSync(
|
|
317
|
+
`powershell -NoProfile -Command "(Get-ScheduledTask -TaskName 'Urban' -ErrorAction SilentlyContinue)?.State"`,
|
|
318
|
+
{ encoding: 'utf8', shell: true, stdio: 'pipe' }
|
|
319
|
+
);
|
|
316
320
|
const state = result.trim();
|
|
321
|
+
if (!state) return { running: false, message: '데몬 미등록' };
|
|
317
322
|
const running = state === 'Running';
|
|
318
323
|
return { running, message: `상태: ${state}` };
|
|
319
324
|
} catch {
|