-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·38 lines (35 loc) · 900 Bytes
/
build.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
#!/bin/bash
set -eo pipefail
#Detect Maike
if command -v maike; then
maike_cmd=maike
elif command -v __maike_bin/maike; then
PATH="`realpath __maike_bin`":"$PATH"
else
if [ -z "$WINDIR" ]; then
if ! command -v jq; then
(>&2 echo "(x) jq is not installed")
exit -1
fi
if ! command -v wget; then
(>&2 echo "(x) wget is not installed")
exit -1
fi
echo "(!) Maike is not available. Downloading the source archive."
mkdir -p __maike_src
wget -O - https://api.github.com/repos/milasudril/maike/releases/latest \
| jq --raw-output '.assets[0].browser_download_url' \
| wget -O - -i - | gzip -dc \
| tar --strip-components=1 -C __maike_src -xf -
cd __maike_src
./build.sh
cd ..
mv __maike_src/__targets __maike_bin
rm -rf __maike_src
PATH="`realpath __maike_bin`":"$PATH"
else
echo "The Windows platorm is not yet supported"
exit 1
fi
fi
maike "$@"