dashcam 1.3.19-beta → 1.3.22-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.
@@ -11,21 +11,8 @@ import fs from 'fs';
11
11
  import path from 'path';
12
12
  import os from 'os';
13
13
 
14
- // Use a consistent location across all contexts
15
- // Windows: C:\ProgramData\dashcam-cli (shared across all users/sessions)
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
@@ -42,7 +42,8 @@ program
42
42
  .command('version')
43
43
  .description('Show version information')
44
44
  .action(() => {
45
- console.log(`Dashcam CLI v${APP.version}`);
45
+ const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
46
+ console.log(`Dashcam CLI v${packageJson.version}`);
46
47
  console.log(`Node.js ${process.version}`);
47
48
  console.log(`Platform: ${process.platform} ${process.arch}`);
48
49
  process.exit(0);
@@ -402,6 +403,9 @@ program
402
403
  .command('stop')
403
404
  .description('Stop the current recording and wait for upload completion')
404
405
  .action(async () => {
406
+
407
+ console.log('!!!! Updated Stop')
408
+
405
409
  try {
406
410
  // Enable verbose logging for stop command
407
411
  setVerbose(true);
@@ -410,9 +414,7 @@ program
410
414
  platform: process.platform,
411
415
  cwd: process.cwd(),
412
416
  pid: process.pid,
413
- processDir: process.platform === 'win32'
414
- ? require('path').join(process.env.PROGRAMDATA || 'C:\\ProgramData', 'dashcam-cli')
415
- : '/tmp/dashcam-cli'
417
+ processDir: require('path').join(require('os').homedir(), '.dashcam-cli')
416
418
  });
417
419
 
418
420
  const isActive = processManager.isRecordingActive();
@@ -421,9 +423,7 @@ program
421
423
  if (!isActive) {
422
424
  console.log('No active recording to stop');
423
425
 
424
- const statusPath = process.platform === 'win32'
425
- ? require('path').join(process.env.PROGRAMDATA || 'C:\\ProgramData', 'dashcam-cli', 'status.json')
426
- : '/tmp/dashcam-cli/status.json';
426
+ const statusPath = require('path').join(require('os').homedir(), '.dashcam-cli', 'status.json');
427
427
 
428
428
  logger.warn('Stop command called but no active recording found', {
429
429
  platform: process.platform,
@@ -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 a consistent location across all contexts
12
- // Windows: C:\ProgramData\dashcam-cli (shared across all users/sessions)
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dashcam",
3
- "version": "1.3.19-beta",
3
+ "version": "1.3.22-beta",
4
4
  "description": "Minimal CLI version of Dashcam desktop app",
5
5
  "main": "bin/dashcam.js",
6
6
  "bin": {