-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·48 lines (45 loc) · 1.67 KB
/
install.sh
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
#!/usr/bin/env bash
uname="$(uname)"
if [ "$(uname)" == "Darwin" ]; then
# Mac OS X platform
sudo curl -o /usr/local/bin/soap -s https://raw.githubusercontent.com/pmamico/soap-cli/main/src/soap && sudo chmod +x /usr/local/bin/soap
INSTALL_PATH=/usr/local/bin/soap
if ! command -v xmlstarlet &> /dev/null
then
brew install xmlstarlet
fi
brew install grep &> /dev/null
elif [ "${uname:0:5}" == "Linux" ]; then
# GNU/Linux platform
sudo curl -o /usr/local/bin/soap -s https://raw.githubusercontent.com/pmamico/soap-cli/main/src/soap && sudo chmod +x /usr/local/bin/soap
INSTALL_PATH=/usr/local/bin/soap
if ! command -v xmlstarlet &> /dev/null
then
sudo snap install xmlstarlet
fi
elif [ "${uname:0:10}" == "MINGW32_NT" ]; then
# 32 bits Windows NT platform
curl -o "$HOME/bin/soap" -s https://raw.githubusercontent.com/pmamico/soap-cli/main/src/soap
INSTALL_PATH="$HOME/bin/soap"
if ! command -v xmlstarlet &> /dev/null
then
"xmlstarlet is missing, please install it"
fi
elif [ "${uname:0:10}" == "MINGW64_NT" ]; then
# 64 bits Windows NT platform
curl -o "$HOME/bin/soap" -s https://raw.githubusercontent.com/pmamico/soap-cli/main/src/soap
INSTALL_PATH=$HOME/bin/soap
if ! command -v xmlstarlet &> /dev/null
then
"xmlstarlet is missing, please install it"
fi
fi
if test -f "$INSTALL_PATH"; then
echo "$(soap --version) was successfully installed. ($INSTALL_PATH)"
if ! command -v highlight &> /dev/null
then
echo "You can optionally install 'highlight' if you want to use pretty print (--pretty)."
fi
else
echo "Failed to install soap-cli"
fi