This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangyang-libzt/check.sh
2017-04-06 19:16:01 -07:00

17 lines
282 B
Bash
Executable File

#!/bin/bash
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
FILE="$1"
if ([ -f "$FILE" ] && [ -s "$FILE" ]) || ([ -d "$FILE" ] && [ "$(ls -A "$FILE")" ]);
then
echo "${green}[OK ]${reset} $FILE"
exit 0
else
echo "${red}[FAIL]${reset} $FILE" >&2
exit 1
fi