From 5de6b7bb6a120e66d295d842b262d12f94cbec30 Mon Sep 17 00:00:00 2001 From: mio <10892119+biuuu@users.noreply.github.com> Date: Mon, 1 May 2023 17:04:04 +0800 Subject: [PATCH] fix: path matching fails when the game is installed in the root directory --- package.json | 2 +- src/main/getData.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index bdc2d1f..fdc9877 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "star-rail-warp-export", - "version": "0.0.2", + "version": "0.0.3", "main": "./dist/electron/main/main.js", "author": "biuuu ", "license": "MIT", diff --git a/src/main/getData.js b/src/main/getData.js index 02261af..ae01eb3 100644 --- a/src/main/getData.js +++ b/src/main/getData.js @@ -115,7 +115,7 @@ const readLog = async () => { } const promises = logPaths.map(async logpath => { const logText = await fs.readFile(logpath, 'utf8') - const gamePathMch = logText.match(/\w:\/.+(Star\sRail\/Game\/StarRail_Data)/) + const gamePathMch = logText.match(/\w:\/.*?(Star\sRail\/Game\/StarRail_Data)/) if (gamePathMch) { const cacheText = await fs.readFile(path.join(gamePathMch[0], '/webCaches/Cache/Cache_Data/data_2'), 'utf8') const urlMch = cacheText.match(/https.+?&auth_appid=webview_gacha&.+?authkey=.+?&game_biz=hkrpg_.+/g)