mirror of
https://github.com/fiso64/slsk-batchdl.git
synced 2025-01-09 15:02: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)
|
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;
|
confPathChanged = true;
|
||||||
|
|
||||||
if (confPath == "none")
|
if (confPath == "none")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
confPath = Utils.ExpandVariables(args[idx + 1]);
|
confPath = Utils.ExpandVariables(args[idx2 + 1]);
|
||||||
if(File.Exists(Path.Join(AppDomain.CurrentDomain.BaseDirectory, confPath)))
|
if(File.Exists(Path.Join(AppDomain.CurrentDomain.BaseDirectory, confPath)))
|
||||||
confPath = Path.Join(AppDomain.CurrentDomain.BaseDirectory, confPath);
|
confPath = Path.Join(AppDomain.CurrentDomain.BaseDirectory, confPath);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue