can read ini file
This commit is contained in:
@@ -2,7 +2,9 @@ const {app, BrowserWindow, ipcMain} = require('electron')
|
||||
const {_android: android} = require('playwright');
|
||||
const startBookWithNumbers = require('./src/appointment')
|
||||
const path = require("path");
|
||||
|
||||
const homedir = require('os').homedir();
|
||||
const loadIniFile = require('read-ini-file')
|
||||
const configFilePath = path.join(homedir, 'config.ini')
|
||||
const createWindow = () => {
|
||||
const win = new BrowserWindow({
|
||||
width: 800,
|
||||
@@ -34,10 +36,14 @@ app.on('window-all-closed', () => {
|
||||
})
|
||||
|
||||
function startBook(startNumber, endNumber, selectedStore) {
|
||||
console.log("startNumber: " + startNumber)
|
||||
console.log("endNumber: " + endNumber)
|
||||
console.log("selectedStore: " + selectedStore)
|
||||
startBookWithNumbers(startNumber, endNumber, selectedStore).then(() => {
|
||||
console.log("startNumber: " + startNumber);
|
||||
console.log("endNumber: " + endNumber);
|
||||
console.log("selectedStore: " + selectedStore);
|
||||
//load config.ini file
|
||||
let config = loadIniFile.sync(configFilePath);
|
||||
console.log(config);
|
||||
let contactExcelFilePath = config.DEFAULT.contact_list_file;
|
||||
startBookWithNumbers(startNumber, endNumber, selectedStore, contactExcelFilePath).then(() => {
|
||||
console.log("stop")
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user