-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·48 lines (41 loc) · 1.26 KB
/
Copy pathindex.js
File metadata and controls
executable file
·48 lines (41 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env node
const path = require('path');
const loudRejection = require('loud-rejection');
const yargs = require('yargs');
const { getAppDataPath } = require('appdata-path');
const findGoogleChrome = require('./lib/helpers/google-chrome-finder');
const authorizeCmd = require('./cmds/authorize');
const synchronizeCmd = require('./cmds/synchronize');
const synchronizeFromFileCmd = require('./cmds/synchronize-from-file');
const APPLICATION_NAME = 'instawhatsapp';
const APPLICATION_FOLDER = getAppDataPath(APPLICATION_NAME);
loudRejection();
const commonOptions = {
headless: {
describe: 'Hide the Google Chrome window used to run WhatsApp Web client',
type: 'boolean',
default: true,
},
'google-chrome-path': {
describe: 'Path to Google Chrome executable',
type: 'string',
default: findGoogleChrome,
},
'sync-state-folder': {
hidden: true,
default: path.join(APPLICATION_FOLDER, 'synchroStates'),
},
'whats-app-data-folder': {
hidden: true,
default: path.join(APPLICATION_FOLDER, 'whatsapp'),
},
};
// eslint-disable-next-line no-unused-expressions
yargs
.options(commonOptions)
.command(synchronizeCmd)
.command(synchronizeFromFileCmd)
.command(authorizeCmd)
.demandCommand()
.help()
.strict().argv;