mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 21:53:41 +00:00

examples are not considered a feature of ThorVG; hence, they are excluded from the src directory. This change allows developers to concentrate more effectively on the core ThorVG sources for practical usages.
29 lines
563 B
Bash
Executable file
29 lines
563 B
Bash
Executable file
#!/bin/bash
|
|
RED='\033[31m'
|
|
GREEN='\033[32m'
|
|
NC='\033[0m'
|
|
|
|
INTERVAL=${1:-2}
|
|
CHECK_OS="`uname -s`"
|
|
|
|
if [[ "$CHECK_OS" = "Darwin"* ]]; then
|
|
EXAMPLES=`find . -perm +111 -type f | sort | uniq`
|
|
else
|
|
EXAMPLES=`find . -executable -type f | sort | uniq`
|
|
fi
|
|
|
|
for EXAMPLE in $EXAMPLES
|
|
do
|
|
if [[ $EXAMPLE == *.sh ]]; then
|
|
continue
|
|
fi
|
|
|
|
echo -e "Execute: "${GREEN}$EXAMPLE${NC}" for "$INTERVAL" second(s)"
|
|
$EXAMPLE &
|
|
EXAMPLE_PID=$!
|
|
sleep $INTERVAL
|
|
kill -s SIGTERM $EXAMPLE_PID
|
|
if [ $? -ne 0 ]; then
|
|
echo -e "Something wrong with: "${RED}$EXAMPLE${NC}
|
|
fi
|
|
done
|