From cac04193de0fa78d513cdc34956b958a4eb6d387 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Tue, 26 Apr 2022 02:26:53 -0700 Subject: [PATCH] openInExplorer function --- resources/js/helpers.js | 4 ++-- resources/js/index.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/js/helpers.js b/resources/js/helpers.js index 4701911..1beba4a 100644 --- a/resources/js/helpers.js +++ b/resources/js/helpers.js @@ -61,14 +61,14 @@ async function openGameFolder() { const config = await getCfg() const folder = config.gameexe.match(/.*\\/g, '')[0] - createCmdWindow(`explorer.exe "${folder}"`) + openInExplorer(folder) } async function openGrasscutterFolder() { const config = await getCfg() const folder = config.serverFolder.match(/.*\\/g, '')[0] - createCmdWindow(`explorer.exe "${folder}"`) + openInExplorer(folder) } /** diff --git a/resources/js/index.js b/resources/js/index.js index 2b3d481..8aaf05d 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -6,6 +6,10 @@ const createCmdWindow = async (command) => { Neutralino.os.execCommand(`cmd.exe /c start "" ${command}`, { background: true }) } +const openInExplorer = async (path) => { + createCmdWindow(`explorer.exe "${path}"`) +} + /** * Enable play buttons */