Mercurial > vim-gutentags
changeset 245:89b41690f374
Check if there are files to generate cscope DB
author | Chayoung You <yousbe@gmail.com> |
---|---|
date | Mon, 08 Apr 2019 16:42:15 +0900 |
parents | d3f9a92399d1 |
children | 97723c1818e0 |
files | plat/unix/update_scopedb.sh plat/win32/update_scopedb.cmd |
diffstat | 2 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/plat/unix/update_scopedb.sh Wed Mar 13 21:56:19 2019 -0700 +++ b/plat/unix/update_scopedb.sh Mon Apr 08 16:42:15 2019 +0900 @@ -88,6 +88,12 @@ echo "\"${l}\"" done > "${DB_FILE}.files" fi + +if [ ! -s "${DB_FILE}.files" ]; then + echo "There is no files to generate cscope DB" + exit +fi + CSCOPE_ARGS="${CSCOPE_ARGS} -i ${DB_FILE}.files" if [ "$BUILD_INVERTED_INDEX" -eq 1 ]; then
--- a/plat/win32/update_scopedb.cmd Wed Mar 13 21:56:19 2019 -0700 +++ b/plat/win32/update_scopedb.cmd Mon Apr 08 16:42:15 2019 +0900 @@ -74,6 +74,14 @@ ) ELSE ( for /F "usebackq delims=" %%F in (`dir /S /B /A-D .`) do @echo "%%F">%DB_FILE%.files ) + +set FILESIZE=0 +for /F %%F in ("%DB_FILE%.files") do set FILESIZE=%%~zF +if %FILESIZE% EQU 0 ( + echo There is no files to generate cscope DB + goto :EOF +) + set CSCOPE_ARGS=%CSCOPE_ARGS% -i %DB_FILE%.files if ["%BUILD_INVERTED_INDEX%"]==["1"] ( set CSCOPE_ARGS=%CSCOPE_ARGS% -q