Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
495 bytes
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 | pkgs=(
|
---|
4 | "com.apple.pkg.DeveloperToolsCLILeo" # standalone
|
---|
5 | "com.apple.pkg.DeveloperToolsCLI" # from XCode
|
---|
6 | "com.apple.pkg.CLTools_Executables" # Mavericks
|
---|
7 | )
|
---|
8 |
|
---|
9 | for pkg in "${pkgs[@]}"; do
|
---|
10 | output=$(/usr/sbin/pkgutil --pkg-info "$pkg" 2>/dev/null)
|
---|
11 | if [ "$output" ]; then
|
---|
12 | version=$(echo "$output" | grep 'version' | cut -d' ' -f2)
|
---|
13 | break
|
---|
14 | fi
|
---|
15 | done
|
---|
16 |
|
---|
17 | if [ "$version" ]; then
|
---|
18 | echo "Command Line Tools version: $version"
|
---|
19 | else
|
---|
20 | echo >&2 'Command Line Tools not found'
|
---|
21 | fi
|
---|
Note:
See
TracBrowser
for help on using the repository browser.