mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-01-05 13:45:25 -06:00
29 lines
677 B
JavaScript
29 lines
677 B
JavaScript
const childProcess = require('child_process');
|
|
const path = require('path');
|
|
const fs = require('fs');
|
|
|
|
class Utils {
|
|
static async openAppInMaximize(appPath) {
|
|
await childProcess.exec('start /MAX ' + appPath);
|
|
}
|
|
|
|
static async killProcess(processName) {
|
|
await childProcess.exec('taskkill /f /t /im ' + processName);
|
|
}
|
|
|
|
static async sleep(ms) {
|
|
return new Promise(resolve => {
|
|
setTimeout(resolve, ms)
|
|
})
|
|
}
|
|
|
|
static getFolderPath(folderName){
|
|
return path.join(require('os').homedir(), folderName);
|
|
}
|
|
|
|
static getFiles(path){
|
|
return fs.readdirSync(path);
|
|
}
|
|
}
|
|
|
|
module.exports = Utils; |