dashcam 1.3.18-beta → 1.3.20-beta
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/dashcam-background.js +2 -15
- package/bin/dashcam.js +14 -6
- package/lib/processManager.js +2 -15
- package/package.json +1 -1
|
@@ -11,21 +11,8 @@ import fs from 'fs';
|
|
|
11
11
|
import path from 'path';
|
|
12
12
|
import os from 'os';
|
|
13
13
|
|
|
14
|
-
// Use
|
|
15
|
-
|
|
16
|
-
// Others: /tmp/dashcam-cli (standard temp location)
|
|
17
|
-
const getProcessDir = () => {
|
|
18
|
-
if (process.platform === 'win32') {
|
|
19
|
-
// Use PROGRAMDATA which is consistent across all contexts on Windows
|
|
20
|
-
const programData = process.env.PROGRAMDATA || 'C:\\ProgramData';
|
|
21
|
-
return path.join(programData, 'dashcam-cli');
|
|
22
|
-
} else {
|
|
23
|
-
// Use /tmp directly on Unix-like systems for consistency
|
|
24
|
-
return '/tmp/dashcam-cli';
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const PROCESS_DIR = getProcessDir();
|
|
14
|
+
// Use user home directory for cross-session communication
|
|
15
|
+
const PROCESS_DIR = path.join(os.homedir(), '.dashcam-cli');
|
|
29
16
|
const STATUS_FILE = path.join(PROCESS_DIR, 'status.json');
|
|
30
17
|
const RESULT_FILE = path.join(PROCESS_DIR, 'upload-result.json');
|
|
31
18
|
|
package/bin/dashcam.js
CHANGED
|
@@ -37,6 +37,18 @@ program
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
+
// Add a dedicated version command that shows more details
|
|
41
|
+
program
|
|
42
|
+
.command('version')
|
|
43
|
+
.description('Show version information')
|
|
44
|
+
.action(() => {
|
|
45
|
+
const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
|
|
46
|
+
console.log(`Dashcam CLI v${packageJson.version}`);
|
|
47
|
+
console.log(`Node.js ${process.version}`);
|
|
48
|
+
console.log(`Platform: ${process.platform} ${process.arch}`);
|
|
49
|
+
process.exit(0);
|
|
50
|
+
});
|
|
51
|
+
|
|
40
52
|
program
|
|
41
53
|
.command('auth')
|
|
42
54
|
.description("Authenticate the dashcam desktop using a team's apiKey")
|
|
@@ -399,9 +411,7 @@ program
|
|
|
399
411
|
platform: process.platform,
|
|
400
412
|
cwd: process.cwd(),
|
|
401
413
|
pid: process.pid,
|
|
402
|
-
processDir:
|
|
403
|
-
? require('path').join(process.env.PROGRAMDATA || 'C:\\ProgramData', 'dashcam-cli')
|
|
404
|
-
: '/tmp/dashcam-cli'
|
|
414
|
+
processDir: require('path').join(require('os').homedir(), '.dashcam-cli')
|
|
405
415
|
});
|
|
406
416
|
|
|
407
417
|
const isActive = processManager.isRecordingActive();
|
|
@@ -410,9 +420,7 @@ program
|
|
|
410
420
|
if (!isActive) {
|
|
411
421
|
console.log('No active recording to stop');
|
|
412
422
|
|
|
413
|
-
const statusPath =
|
|
414
|
-
? require('path').join(process.env.PROGRAMDATA || 'C:\\ProgramData', 'dashcam-cli', 'status.json')
|
|
415
|
-
: '/tmp/dashcam-cli/status.json';
|
|
423
|
+
const statusPath = require('path').join(require('os').homedir(), '.dashcam-cli', 'status.json');
|
|
416
424
|
|
|
417
425
|
logger.warn('Stop command called but no active recording found', {
|
|
418
426
|
platform: process.platform,
|
package/lib/processManager.js
CHANGED
|
@@ -8,21 +8,8 @@ import { logger } from './logger.js';
|
|
|
8
8
|
const __filename = fileURLToPath(import.meta.url);
|
|
9
9
|
const __dirname = path.dirname(__filename);
|
|
10
10
|
|
|
11
|
-
// Use
|
|
12
|
-
|
|
13
|
-
// Others: /tmp/dashcam-cli (standard temp location)
|
|
14
|
-
const getProcessDir = () => {
|
|
15
|
-
if (process.platform === 'win32') {
|
|
16
|
-
// Use PROGRAMDATA which is consistent across all contexts on Windows
|
|
17
|
-
const programData = process.env.PROGRAMDATA || 'C:\\ProgramData';
|
|
18
|
-
return path.join(programData, 'dashcam-cli');
|
|
19
|
-
} else {
|
|
20
|
-
// Use /tmp directly on Unix-like systems for consistency
|
|
21
|
-
return '/tmp/dashcam-cli';
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const PROCESS_DIR = getProcessDir();
|
|
11
|
+
// Use user home directory for cross-session communication
|
|
12
|
+
const PROCESS_DIR = path.join(os.homedir(), '.dashcam-cli');
|
|
26
13
|
const STATUS_FILE = path.join(PROCESS_DIR, 'status.json');
|
|
27
14
|
const RESULT_FILE = path.join(PROCESS_DIR, 'upload-result.json');
|
|
28
15
|
|