fix: only validate psu path if its not empty
This commit is contained in:
1 file changed
+30
-28
+30
-28
@@ -133,36 +133,38 @@
|
|||||||
|
|
||||||
if (!$firstStartup) {
|
if (!$firstStartup) {
|
||||||
currentLoadingInfo.set('Checking osu installation path...');
|
currentLoadingInfo.set('Checking osu installation path...');
|
||||||
const validFolder = await isValidOsuFolder($osuInstallationPath);
|
if ($osuInstallationPath && $osuInstallationPath.length > 0) {
|
||||||
if (!validFolder) {
|
const validFolder = await isValidOsuFolder($osuInstallationPath);
|
||||||
osuInstallationPath.set('');
|
if (!validFolder) {
|
||||||
await config.value<string>('osu_installation_path').set('');
|
await config.value<string>('osu_installation_path').set('');
|
||||||
sileo.error({
|
osuInstallationPath.set('');
|
||||||
title: 'Hmm...',
|
sileo.error({
|
||||||
description: 'Your previously set osu! installation path seems to be invalid.',
|
title: 'Hmm...',
|
||||||
});
|
description: 'Your previously set osu! installation path seems to be invalid.',
|
||||||
} else {
|
});
|
||||||
currentLoadingInfo.set('Getting osu version...');
|
|
||||||
const osuReleaseStream = await getReleaseStream($osuInstallationPath);
|
|
||||||
osuStream.set(osuReleaseStream);
|
|
||||||
const osuVersion = await getVersion($osuInstallationPath);
|
|
||||||
osuBuild.set(osuVersion);
|
|
||||||
|
|
||||||
currentLoadingInfo.set('Counting beatmapsets...');
|
|
||||||
const beatmapSetCount = await getBeatmapSetsCount($osuInstallationPath);
|
|
||||||
if (beatmapSetCount !== null) beatmapSets.set(beatmapSetCount);
|
|
||||||
|
|
||||||
currentLoadingInfo.set('Counting skins...');
|
|
||||||
const skins_list = await getSkins($osuInstallationPath);
|
|
||||||
if (skins_list) {
|
|
||||||
skins.set(skins_list);
|
|
||||||
skinsCount.set(skins_list.length);
|
|
||||||
} else {
|
} else {
|
||||||
skinsCount.set(0);
|
currentLoadingInfo.set('Getting osu version...');
|
||||||
}
|
const osuReleaseStream = await getReleaseStream($osuInstallationPath);
|
||||||
|
osuStream.set(osuReleaseStream);
|
||||||
|
const osuVersion = await getVersion($osuInstallationPath);
|
||||||
|
osuBuild.set(osuVersion);
|
||||||
|
|
||||||
const skin: string = await getSkin($osuInstallationPath);
|
currentLoadingInfo.set('Counting beatmapsets...');
|
||||||
currentSkin.set(skin);
|
const beatmapSetCount = await getBeatmapSetsCount($osuInstallationPath);
|
||||||
|
if (beatmapSetCount !== null) beatmapSets.set(beatmapSetCount);
|
||||||
|
|
||||||
|
currentLoadingInfo.set('Counting skins...');
|
||||||
|
const skins_list = await getSkins($osuInstallationPath);
|
||||||
|
if (skins_list) {
|
||||||
|
skins.set(skins_list);
|
||||||
|
skinsCount.set(skins_list.length);
|
||||||
|
} else {
|
||||||
|
skinsCount.set(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
const skin: string = await getSkin($osuInstallationPath);
|
||||||
|
currentSkin.set(skin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user