6b13f685e
김민수
BSP 최초 추가
|
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
usage() {
cat <<EOF
Usage:
$0 library
Look for Erlang's library in TARGET_DIR/usr/lib/erlang/lib.
If the library is found, it returns the path to the latest version,
relative to TARGET_DIR. Otherwise, it returns "not found".
If there are several versions, it returns an error because it does not
know which one Erlang uses.
EOF
}
die () {
echo "$@" >&2
exit 1
}
if [ $
usage
exit 0
else
library="$1"
fi
target_dir="${TARGET_DIR:-output/target}"
[ -d "$target_dir" ] || die "TARGET_DIR is not a directory. Please \
specify the TARGET_DIR environment variable."
case "$(ls -1d -- "$target_dir/usr/lib/erlang/lib/$library-"* | wc -l)" in
0)
echo "not found"
;;
1)
echo "$target_dir/usr/lib/erlang/lib/$library-"* \
| sed -e "s,^$target_dir,,"
;;
*)
die "Several versions of $library have been found. Please \
remove the unused ones."
;;
esac
|