Fix a bug when creating Config directory

This commit is contained in:
Yeechan Lu 2014-03-23 16:58:19 +08:00
parent fc4778159c
commit 2554165963

View File

@ -41,11 +41,8 @@ namespace Wox.Infrastructure.Storage
string configPath = Path.Combine(configFolder, ConfigName + fileSuffix); string configPath = Path.Combine(configFolder, ConfigName + fileSuffix);
if (!File.Exists(configPath)) if (!File.Exists(configPath))
{ {
FileInfo fileInfo = new FileInfo(configFolder); if (!Directory.Exists(configFolder))
if (!fileInfo.Directory.Exists) Directory.CreateDirectory(configFolder);
{
fileInfo.Directory.Create();
}
File.Create(configPath).Close(); File.Create(configPath).Close();
} }
string json = File.ReadAllText(configPath); string json = File.ReadAllText(configPath);