Skip to content

Commit

Permalink
Add GH installers
Browse files Browse the repository at this point in the history
  • Loading branch information
svarlamov committed Nov 30, 2018
1 parent adb1110 commit f7a9181
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 3 deletions.
30 changes: 27 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions install-root.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,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."
43 changes: 43 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/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 "Preparing to install binary by elevating permissions ..."
sudo echo "Successfully elevated permissions to install binary"

echo "Installing binary ..."
sudo cp ${OS}-${ARCH}-mdlr ${INSTALL_ROOT}mdlr
sudo 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."

0 comments on commit f7a9181

Please sign in to comment.