Skip to content

Commit

Permalink
use a correct args type
Browse files Browse the repository at this point in the history
  • Loading branch information
jibon57 committed Nov 10, 2023
1 parent 06d05af commit 1d2f34e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions post_processing_scripts/example.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const args = process.argv.slice(2);

if (!args) {
if (!args.length) {
console.log('no option sent');
process.exit();
}

// should get JSON value
console.log(args);
console.log(args[0]);

/*
'{"recording_id":"RM_WiTK7pMya8Hc-1698923776909","room_table_id":841,"room_sid":"RM_WiTK7pMya8Hc","file_path":"../recording_files/node_01/RM_WiTK7pMya8Hc/RM_WiTK7pMya8Hc-1698923776909.mp4","file_size":0.32,"recorder_id":"node_01"}'
Expand Down
6 changes: 3 additions & 3 deletions src/recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
StartRecorderChildArgs,
} from './proto/plugnmeet_recorder_pb';

const args: any = process.argv.slice(2),
const args = process.argv.slice(2),
platform = os.platform();

let browser: Browser, page: Page, xvfb: any;
Expand All @@ -28,11 +28,11 @@ let hasError = false,
closedBycmd = false,
wasCalledClose = false;

if (!args) {
if (!args.length) {
logger.error('no args found, closing..');
process.exit();
}
const recorderArgs = StartRecorderChildArgs.fromJsonString(args);
const recorderArgs = StartRecorderChildArgs.fromJsonString(args[0]);

const width = recorderArgs.width || 1800;
const height = recorderArgs.height || 900;
Expand Down

0 comments on commit 1d2f34e

Please sign in to comment.