aicp-tracker 1.1.1 → 1.1.3
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/bin/setup.js +8 -14
- package/package.json +1 -1
package/bin/setup.js
CHANGED
|
@@ -27,8 +27,7 @@ const os = require('os');
|
|
|
27
27
|
const config = require('../src/config');
|
|
28
28
|
const daemon = require('../src/daemon');
|
|
29
29
|
|
|
30
|
-
const API_URL
|
|
31
|
-
const TASK_NAME = 'AI Code Pulse Tracker';
|
|
30
|
+
const API_URL = 'https://aicp-tracker.duckdns.org';
|
|
32
31
|
|
|
33
32
|
const PLANS = [
|
|
34
33
|
'Pro (monthly)',
|
|
@@ -47,17 +46,11 @@ function installAutoStart() {
|
|
|
47
46
|
|
|
48
47
|
try {
|
|
49
48
|
if (process.platform === 'win32') {
|
|
50
|
-
//
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
fs.
|
|
55
|
-
fs.writeFileSync(wrapperPath, `@echo off\r\n"${nodePath}" "${scriptPath}" start\r\n`);
|
|
56
|
-
execFileSync('schtasks', [
|
|
57
|
-
'/create', '/tn', TASK_NAME,
|
|
58
|
-
'/tr', wrapperPath,
|
|
59
|
-
'/sc', 'ONLOGON', '/f',
|
|
60
|
-
], { stdio: 'pipe' });
|
|
49
|
+
// Use the user Startup folder — no admin rights needed, runs at every login
|
|
50
|
+
const startupDir = path.join(os.homedir(), 'AppData', 'Roaming', 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'Startup');
|
|
51
|
+
const startupPath = path.join(startupDir, 'aicp-tracker.cmd');
|
|
52
|
+
fs.mkdirSync(startupDir, { recursive: true });
|
|
53
|
+
fs.writeFileSync(startupPath, `@echo off\r\n"${nodePath}" "${scriptPath}" start\r\n`);
|
|
61
54
|
} else if (process.platform === 'darwin') {
|
|
62
55
|
const plistDir = path.join(os.homedir(), 'Library', 'LaunchAgents');
|
|
63
56
|
const plistPath = path.join(plistDir, 'com.aicp-tracker.plist');
|
|
@@ -96,7 +89,8 @@ WantedBy=default.target
|
|
|
96
89
|
execSync('systemctl --user daemon-reload && systemctl --user enable --now aicp-tracker', { stdio: 'ignore' });
|
|
97
90
|
}
|
|
98
91
|
return true;
|
|
99
|
-
} catch {
|
|
92
|
+
} catch (e) {
|
|
93
|
+
console.error('[auto-start error]', e.message, e.stderr?.toString());
|
|
100
94
|
return false;
|
|
101
95
|
}
|
|
102
96
|
}
|