[opt] verify param template_search_path (#37)

main
Skyhand 2022-12-30 18:12:48 +08:00 committed by GitHub
parent b37f2692e3
commit 874f966a40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -10,6 +10,7 @@ using Luban.Job.Common.Utils;
using Luban.Server; using Luban.Server;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -137,7 +138,15 @@ Options:
case "-t": case "-t":
case "--template_search_path": case "--template_search_path":
{ {
ops.TemplateSearchPath = args[++i]; var dirName = args[++i];
if (Directory.Exists(dirName))
{
ops.TemplateSearchPath = dirName;
}
else
{
Console.WriteLine("[WARN] 对于Luban.ClientServer参数 {0} {1} 路径不存在,忽略。", arg, dirName);
}
break; break;
} }
case "--": case "--":