fix a bug while reading log

This commit is contained in:
JerryXiao 2019-09-08 19:05:09 +08:00
parent 1ef1c3a066
commit 3b0d45dfb1
1 changed files with 3 additions and 3 deletions

View File

@ -54,9 +54,9 @@ def readpkglog(pkgdirname, update=False):
return f"{cwd / logfile} cannot be found"
def readmainlog(debug=False):
logfile = MAIN_LOGFILE if debug else CONSOLE_LOGFILE
if (PKGBUILD_DIR / logfile).exists():
if (Path('.') / logfile).exists():
logger.debug(f'formatting buildbot{" debug" if debug else ""} logs')
return __simpleread(PKGBUILD_DIR / logfile)
return __simpleread(Path('.') / logfile)
else:
logger.debug(f'not found: buildbot{" debug" if debug else ""} log')
return f"{PKGBUILD_DIR / logfile} cannot be found"
return f"{Path('.') / logfile} cannot be found"