summaryrefslogtreecommitdiff
path: root/requirements/req.sh
blob: 335c3224a9bbd276bf382086fdb3c0625efbbbd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

command="$1"
script="$(dirname $0)/scripts/req-${command}"
if [ -x "$script" ]
then
    shift 1
    $script $@
    exit 0
fi

if [ -f "$script" ]
then
    echo "$script is not executable. Try chmod +x $script and try again."
    exit 1
fi

if [ -a "$script" ]
then
    echo "$script is not a regular file. Try replacing $script with an executable and try again."
    exit 1
fi

echo "$script does not exist."
exit 1