-
Notifications
You must be signed in to change notification settings - Fork 0
/
logic.js
33 lines (29 loc) · 860 Bytes
/
logic.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
const fs = require('fs');
const path = require('path');
const {ipcRenderer} = require('electron');
const config = JSON.parse(fs.readFileSync('./pathConfig.json'));
console.log(config.trunkPath);
exports.onCopyClick = function (btnIns) {
if(config.trunkPath=="" || config.stablePath=="")
{
}
ipcRenderer.sendSync("fhyhahahahah");
var files=[];
fs.readdirSync('.').forEach(function (file) {
var pathname = path.join('.', file);
if (!fs.statSync(pathname).isDirectory()) {
files.push(pathname);
}
});
console.log(files);
var selectJson = btnIns.value;
if (files.find(function (e) { return e == selectJson; })) {
console.log("fhy right");
}
else {
console.log("fhy wrong");
}
}
exports.onInputChange = function (textIns) {
console.log(textIns.value);
}