mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
CreateSubDirectory removed. Fixes the empty root issue
This commit is contained in:
@ -47,8 +47,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
var directoryInfos = target.GetDirectories();
|
var directoryInfos = target.GetDirectories();
|
||||||
var fileInfos = target.GetFiles();
|
var fileInfos = target.GetFiles();
|
||||||
|
|
||||||
//With an empty disk (mb flash drive), this if could be false
|
if (directoryInfos.Length > 0 || fileInfos.Length > 0 || target.Parent == null)
|
||||||
if (directoryInfos.Length > 0 || fileInfos.Length > 0)
|
|
||||||
{
|
{
|
||||||
// Quick test for whether there's already an osu! install at the target path.
|
// Quick test for whether there's already an osu! install at the target path.
|
||||||
if (fileInfos.Any(f => f.Name == OsuGameBase.CLIENT_DATABASE_FILENAME))
|
if (fileInfos.Any(f => f.Name == OsuGameBase.CLIENT_DATABASE_FILENAME))
|
||||||
@ -66,11 +65,8 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check for a root directory
|
//We aren't using CreateSubDirectory due to the flaw with a root of a drive
|
||||||
if (target.Parent == null)
|
target = Directory.CreateDirectory(Path.Combine(target.FullName, "osu-lazer"));
|
||||||
target = Directory.CreateDirectory(Path.Combine(target.FullName, "osu-lazer"));
|
|
||||||
else
|
|
||||||
target = target.CreateSubdirectory("osu-lazer");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
Reference in New Issue
Block a user