@clazic/urban 0.2.10 → 0.2.12
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 +8 -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
|
@@ -79,7 +79,14 @@ export function buildPowerShellCmd({ nodePath, daemonJs }) {
|
|
|
79
79
|
return `
|
|
80
80
|
$action = New-ScheduledTaskAction -Execute '${escapedNodePath}' -Argument '"${escapedDaemonJs}"'
|
|
81
81
|
$trigger = New-ScheduledTaskTrigger -AtLogOn
|
|
82
|
-
$settings = New-ScheduledTaskSettingsSet
|
|
82
|
+
$settings = New-ScheduledTaskSettingsSet \`
|
|
83
|
+
-ExecutionTimeLimit 0 \`
|
|
84
|
+
-AllowStartIfOnBatteries \`
|
|
85
|
+
-DontStopIfGoingOnBatteries \`
|
|
86
|
+
-StartWhenAvailable \`
|
|
87
|
+
-MultipleInstances IgnoreNew \`
|
|
88
|
+
-RestartCount 5 \`
|
|
89
|
+
-RestartInterval (New-TimeSpan -Minutes 1)
|
|
83
90
|
Register-ScheduledTask -TaskName 'Urban' -Action $action -Trigger $trigger -Settings $settings -Force
|
|
84
91
|
`;
|
|
85
92
|
}
|