aicp-tracker 1.0.9 → 1.1.0
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 +7 -3
- package/package.json +1 -1
package/bin/setup.js
CHANGED
|
@@ -47,9 +47,13 @@ function installAutoStart() {
|
|
|
47
47
|
|
|
48
48
|
try {
|
|
49
49
|
if (process.platform === 'win32') {
|
|
50
|
-
//
|
|
51
|
-
const
|
|
52
|
-
|
|
50
|
+
// execFileSync bypasses cmd.exe so quotes in paths are passed literally to schtasks
|
|
51
|
+
const { execFileSync } = require('child_process');
|
|
52
|
+
execFileSync('schtasks', [
|
|
53
|
+
'/create', '/tn', TASK_NAME,
|
|
54
|
+
'/tr', `"${nodePath}" "${scriptPath}" start`,
|
|
55
|
+
'/sc', 'ONLOGON', '/f',
|
|
56
|
+
], { stdio: 'pipe' });
|
|
53
57
|
} else if (process.platform === 'darwin') {
|
|
54
58
|
const plistDir = path.join(os.homedir(), 'Library', 'LaunchAgents');
|
|
55
59
|
const plistPath = path.join(plistDir, 'com.aicp-tracker.plist');
|