]> git.saurik.com Git - apt.git/blob - CMake/run_if_exists.sh
test: Substitute GNU commands for other commands where available
[apt.git] / CMake / run_if_exists.sh
1 #!/bin/sh
2 # Small helper for running a command
3 out=""
4 if [ "$1" = "--stdout" ]; then
5 out="$2"
6 shift 2
7 fi
8
9 if [ -e "$1" ]; then
10 shift
11 if [ "$out" ]; then
12 exec "$@" > $out
13 else
14 exec "$@"
15 fi
16 fi