Refactor readPacmanConfig
removed one indentation
This commit is contained in:
parent
42fe907ec8
commit
25004cd83b
@ -36,19 +36,21 @@ public partial class PacserverUtils {
|
|||||||
string cachePath = pathsToDetermine[0];
|
string cachePath = pathsToDetermine[0];
|
||||||
string dbPath = pathsToDetermine[1];
|
string dbPath = pathsToDetermine[1];
|
||||||
|
|
||||||
if (line.Contains(cachePath) || line.Contains(dbPath)) {
|
if (!line.Contains(cachePath) && !line.Contains(dbPath)) {
|
||||||
Match match = CacheDirOrDBPathRegex().Match(line);
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Match match = CacheDirOrDBPathRegex().Match(line);
|
||||||
|
|
||||||
if(!match.Success) {
|
if(!match.Success) {
|
||||||
string pathsToDetermineString = string.Join(",", pathsToDetermine);
|
string pathsToDetermineString = string.Join(",", pathsToDetermine);
|
||||||
throw new DirectoryNotFoundException("Could not determine the necessary file paths: " + pathsToDetermineString);
|
throw new DirectoryNotFoundException("Could not determine the necessary file paths: " + pathsToDetermineString);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.Contains(cachePath)) {
|
if (line.Contains(cachePath)) {
|
||||||
pacmanCacheDirectory = match.ToString();
|
pacmanCacheDirectory = match.ToString();
|
||||||
} else if (line.Contains(dbPath)) {
|
} else if (line.Contains(dbPath)) {
|
||||||
pacmanDatabaseDirectory = match.ToString();
|
pacmanDatabaseDirectory = match.ToString();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user