Commit 895522aa authored by Liang Ding's avatar Liang Ding

📈 #12293 导入 MD 日志输出

parent 923b1f6b
......@@ -37,7 +37,7 @@ import java.util.*;
* Import service.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.1, Jun 26, 2017
* @version 1.0.0.2, Jul 3, 2017
* @since 2.2.0
*/
@Service
......@@ -91,6 +91,10 @@ public class ImportService {
int succCnt = 0, failCnt = 0;
final Set<String> failSet = new TreeSet<>();
final Collection<File> mds = FileUtils.listFiles(new File(markdownsPath), new String[]{"md"}, true);
if (null == mds || mds.isEmpty()) {
return;
}
for (final File md : mds) {
final String fileName = md.getName();
if (StringUtils.equalsIgnoreCase(fileName, "README.md")) {
......@@ -117,6 +121,10 @@ public class ImportService {
}
}
if (0 == succCnt && 0 == failCnt) {
return;
}
final StringBuilder logBuilder = new StringBuilder();
logBuilder.append("[").append(succCnt).append("] imported, [").append(failCnt).append("] failed");
if (failCnt > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment