-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
54 lines (47 loc) · 1.28 KB
/
index.js
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
49
50
51
#!/usr/bin/env node
const inquirer = require('inquirer');
const { createVoicemailFile } = require('./utils');
const child = require('child_process').spawn;
const path = require('path');
const fs = require('fs');
const chalk = require('chalk');
const header = require('boxen');
const script = path.format({dir: __dirname, base: 'pager.js'});
console.log(chalk.magenta(
header('Instagram Voicemail v1.0', {
padding: 1,
borderColor: 'magenta',
borderStyle: 'classic'
})
));
inquirer.prompt([
{
type: 'input',
message: chalk.magenta('Please insert your Instagram username:'),
name: 'username'
},
{
type: 'password',
message: chalk.magenta('Please insert your Instagram password:'),
name: 'password'
},
{
type: 'confirm',
message: chalk.magenta('Do you want enable voicemail bot?'),
name: 'enableBot'
}
]).then( (answers) => {
if( answers.enableBot ){
createVoicemailFile();
}
child(process.execPath, [script], {
cwd: __dirname,
env: {
IG_USERNAME: answers.username,
IG_PASSWORD: answers.password,
ENABLE_BOT: answers.enableBot,
FORCE_COLOR: 3
},
stdio: 'inherit'
});
});