-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
82 lines (60 loc) · 1.84 KB
/
app.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
var Promise = require('bluebird');
var path = require('path');
//this is used to easily require non-sibling modules from subdirectories
global.dir = path.dirname(require.main.filename);
var prompt = require(global.dir + '/modules/prompt');
var database = require(global.dir + '/modules/database');
var chat = require(global.dir + '/modules/chat');
var backup = require(global.dir + '/modules/backup');
backup.loadBackups().then(function(backups){
return prompt(backups);
}).then(function(chosen_backup){
console.log("");
return backup.readWechatInfo(chosen_backup);
});
setInterval(function(){},1000);
// backup.readPlist().then(function(data){
// console.log(JSON.stringify(data));
// });
// return;
// prompt().tap(function(){
// console.log("");
// }).then(function(result){
// //remove whitespace from strings
// Object.keys(result).forEach(function(key){
// result[key] = result[key].trim();
// })
// if(result.root_path.slice(-1) !== '/'){
// result.root_path += '/';
// }
// //dev override
// result.root_path = '/Users/freeman/Projects/wechat-logs/raw/';
// result.user_hash = 'b7e1ad495c6e37b828e02cc1c650f785';
// global.config = result;
// return database.init();
// }).tap(function(){
// console.log("");
// }).then(function(){
// return database.listChatHashes();
// }).tap(function(){
// console.log("");
// }).then(function(hashes){
// var operations = [];
// hashes.forEach(function(hash){
// operations.push(database.getLogs(hash.name))
// });
// return Promise.all(operations)
// }).tap(function(){
// console.log("");
// }).then(function(logs){
// var operations = [];
// logs.forEach(function(log){
// operations.push(chat.generate(log));
// })
// return Promise.all(operations);
// }).tap(function(){
// console.log("");
// }).then(function(){
// console.log("😎 Done!");
// process.exit()
// });