-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall-root.sh
40 lines (34 loc) · 1 KB
/
install-root.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
#!/usr/bin/env bash
set -e
echo "Installer loaded ..."
GH_URL='https://github.com/exlinc/mdlr/releases/download'
VERSION='v1.0.0'
echo "Preparing to install mdlr@$VERSION ..."
echo "Creating temp directory ..."
mkdir .mdlr-install
cd .mdlr-install
echo "Temp directory created ..."
echo "Selecting binary for this system ..."
INSTALL_ROOT='/usr/local/bin/'
MACHINE_TYPE=`uname -m`
ARCH='386'
OS='linux'
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
ARCH='amd64'
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
OS='darwin'
fi
echo "Successfully selected binary for this system"
echo "Downloading binary ..."
curl ${GH_URL}/${VERSION}/${OS}-${ARCH}-mdlr -o ${OS}-${ARCH}-mdlr
echo "Successfully downloaded binary"
echo "Installing binary ..."
cp ${OS}-${ARCH}-mdlr ${INSTALL_ROOT}mdlr
chmod +x /usr/local/bin/mdlr
echo "Successfully installed binary"
echo "Removing temp directories ..."
cd ..
rm -rf .mdlr-install
echo "Removed temp directories"
echo "Installation complete. Try running 'mdlr --help' to check your setup."