prettier
This commit is contained in:
@@ -4,7 +4,7 @@ const helpers = require('../../helpers');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
|
||||
const addListeners = (ipcMain, { detectScript }) => {
|
||||
const addListeners = (ipcMain, {detectScript}) => {
|
||||
ipcMain.on(Constants.IPC_Get_Platform, (event) => {
|
||||
const sendResponse = (appPlatform, platform) => {
|
||||
event.sender.send(Constants.IPC_Get_Platform_Reply, {
|
||||
@@ -19,32 +19,32 @@ const addListeners = (ipcMain, { detectScript }) => {
|
||||
fs.writeFileSync(scriptFile, detectScript);
|
||||
|
||||
helpers
|
||||
.executeScript(scriptFile)
|
||||
.then((data) => {
|
||||
let appPlatform = data.replace(/(\r\n|\n|\r)/gm, '');
|
||||
if (appPlatform === 'unknown') {
|
||||
helpers.downloadFile(Constants.LINUX_DETECT_SCRIPT_URL, scriptFile, null, (err) => {
|
||||
if (err) {
|
||||
.executeScript(scriptFile)
|
||||
.then((data) => {
|
||||
let appPlatform = data.replace(/(\r\n|\n|\r)/gm, '');
|
||||
if (appPlatform === 'unknown') {
|
||||
helpers.downloadFile(Constants.LINUX_DETECT_SCRIPT_URL, scriptFile, null, (err) => {
|
||||
if (err) {
|
||||
sendResponse(appPlatform, platform);
|
||||
} else {
|
||||
helpers
|
||||
.executeScript(scriptFile)
|
||||
.then((data) => {
|
||||
appPlatform = data.replace(/(\r\n|\n|\r)/gm, '');
|
||||
sendResponse(appPlatform, platform);
|
||||
} else {
|
||||
helpers
|
||||
.executeScript(scriptFile)
|
||||
.then((data) => {
|
||||
appPlatform = data.replace(/(\r\n|\n|\r)/gm, '');
|
||||
sendResponse(appPlatform, platform);
|
||||
})
|
||||
.catch(() => {
|
||||
sendResponse(appPlatform, platform);
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
sendResponse(appPlatform, platform);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
sendResponse(platform, platform);
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
sendResponse(appPlatform, platform);
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
sendResponse(appPlatform, platform);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
sendResponse(platform, platform);
|
||||
});
|
||||
} else {
|
||||
sendResponse(platform, platform);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user