mirror of
https://github.com/fiso64/slsk-batchdl.git
synced 2025-01-08 06:22:43 +00:00
no-config fix
This commit is contained in:
parent
91c70fcfcd
commit
2fbec8e811
1 changed files with 12 additions and 3 deletions
|
@ -193,16 +193,25 @@ public class Config
|
|||
|
||||
void SetConfigPath(string[] args)
|
||||
{
|
||||
int idx = Array.FindLastIndex(args, x => x == "-c" || x == "--config");
|
||||
int idx1 = Array.FindLastIndex(args, x => x == "--nc" || x == "--no-config");
|
||||
|
||||
if (idx != -1)
|
||||
if (idx1 != -1 && !(idx1 < args.Length - 1 && args[idx1 + 1] == "false"))
|
||||
{
|
||||
confPath = "none";
|
||||
confPathChanged = true;
|
||||
return;
|
||||
}
|
||||
|
||||
int idx2 = Array.FindLastIndex(args, x => x == "-c" || x == "--config");
|
||||
|
||||
if (idx2 != -1)
|
||||
{
|
||||
confPathChanged = true;
|
||||
|
||||
if (confPath == "none")
|
||||
return;
|
||||
|
||||
confPath = Utils.ExpandVariables(args[idx + 1]);
|
||||
confPath = Utils.ExpandVariables(args[idx2 + 1]);
|
||||
if(File.Exists(Path.Join(AppDomain.CurrentDomain.BaseDirectory, confPath)))
|
||||
confPath = Path.Join(AppDomain.CurrentDomain.BaseDirectory, confPath);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue