public static Config CreateInitialConfig(string fullPath) {
// Get the user name.
string userName = "Unknown";
if (Backend.Platform == PlatformID.Unix ||
Backend.Platform == PlatformID.MacOSX) {
userName = string.IsNullOrEmpty(Environment.UserName) ? string.Empty : Environment.UserName.TrimEnd(",".ToCharArray());
} else {
userName = Environment.UserName;
}
if (string.IsNullOrEmpty(userName)) {
userName = "Unknown";
}
return new Config(fullPath) {
Folders = new List<RepoInfo>(),
User = new User {
EMail = "Unknown",
Name = userName
},
Notifications = true,
Log4Net = CreateDefaultLog4NetElement(GetLogFilePath(Path.GetDirectoryName(fullPath)), GetOperationsLogFilePath(Path.GetDirectoryName(fullPath))),
DeviceId = Guid.NewGuid(),
IgnoreFileNames = CreateInitialListOfGloballyIgnoredFileNames(),
IgnoreFolderNames = CreateInitialListOfGloballyIgnoredFolderNames(),
HiddenRepoNames = CreateInitialListOfGloballyHiddenRepoNames(),
Version = 1.1,
fullpath = fullPath
};
}