Skip to content

Commit 5648f05

Browse files
committed
Resolve Mac build Issue
1 parent 15c0eff commit 5648f05

38 files changed

+7685
-6941
lines changed

.idea/workspace.xml

Lines changed: 408 additions & 252 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lowdbFunc.js

Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,39 @@
11
import {prod_app_directory, production} from './src/main/libs/config';
22
import os from 'os';
3-
import fs from 'fs';
43
import shell from 'shelljs';
4+
import {ipcRenderer} from "electron";
55
var adapter;
6-
// const cryptoJSON = require('crypto-json');
76
const low = require('lowdb')
87
const FileSync = require('lowdb/adapters/FileSync')
98

9+
let db;
10+
console.log("Ress 3 startAppRes lowdb 2")
11+
1012
if (production) {
1113
let appPath = "~/Library/Application Support/"+prod_app_directory;
1214
if(os.type() == 'Windows_NT') {
1315
appPath = "~/AppData/Roaming/"+prod_app_directory;
14-
shell.cd(appPath);
15-
16+
if(appPath) {
17+
shell.cd(appPath);
18+
}
1619
}
1720
if(os.type() == 'Linux') {
1821
appPath = "~/.config/"+prod_app_directory;
1922
shell.cd(appPath);
20-
23+
2124
}
2225
if(os.type() == 'Darwin') {
2326
appPath = "~/Library/Application Support/"+prod_app_directory;
2427
shell.cd(appPath);
2528
}
2629

27-
// console.log("check path11111", shell.ls(''), shell.ls('') && shell.ls('').find((ele)=> console.log(ele)));
2830
adapter = new FileSync('db.json');
2931
console.log(adapter, "lowdbfunc");
30-
3132
} else {
3233
adapter = new FileSync('/Users/farina/Desktop/Projects/LunaWalletVueTest/db.json');
3334
}
3435

35-
let db = low(adapter);
36-
37-
//
38-
// const algorithm = 'camellia-128-cbc';
39-
// const encoding = 'hex';
40-
//
41-
// const input = {
42-
// accounts: db.get('accounts').value(),
43-
// contracts: db.get('contracts').value(),
44-
// tokens: db.get('tokens').value(),
45-
// accountsAdresses: db.get('accountsAdresses').value(),
46-
// hdWallets: db.get('hdWallets').value(),
47-
// transactions: db.get('transactions').value(),
48-
// }
49-
//
50-
// // console.log(db.get('accounts').value());
51-
//
52-
// const password = '123123123'
53-
//
54-
// // keys act like a white list, so for example if you want to encrypt a nested
55-
// // key "test" you also need to specify its parent keys,
56-
// // i.e. "b", "a", "baz", "hello" in the above input object
57-
//
58-
//
59-
//
60-
// const keys = ['accounts', 'accountTitle', 'hash', 'archive', 'isHd',
61-
// 'contracts','id','contract_name','contract_address','contract_json','constant','inputs','name','outputs','type','payable',
62-
// 'stateMutability','signature','anonymous','indexed','token_address','token_name','token_symbol','tokenType',
63-
// 'tokens', 'accountsAdresses', 'hdWallets', 'transactions', 'logs','address', 'topics' ];
64-
//
65-
// const output = cryptoJSON.encrypt(
66-
// input, password, {encoding, keys, algorithm}
67-
// );
68-
//
69-
// console.log(output);
36+
db = low(adapter);
7037

7138
db.defaults({ accounts: [], contracts: [], tokens: [
7239
{
@@ -90,6 +57,7 @@ db.defaults({ accounts: [], contracts: [], tokens: [
9057
] , accountsAdresses:[] , hdWallets:[] , transactions : [] })
9158
.write();
9259

60+
9361
export {
9462
db, adapter, low
9563
}

0 commit comments

Comments
 (0)