Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
feat: support linux installation flow
Browse files Browse the repository at this point in the history
  • Loading branch information
dimabru committed Apr 19, 2021
1 parent ce3d0f7 commit a511db9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh
#!/bin/bash

osName=$(uname -s)
DOWNLOAD_URL=$(curl --silent "https://api.github.com/repos/datreeio/datree/releases/latest" | grep -o "browser_download_url.*\_${osName}_x86_64.zip")

DOWNLOAD_URL=$(curl --silent "https://api.github.com/repos/datreeio/datree/releases/latest" | grep -o "browser_download_url.*\_Darwin_x86_64.zip")
DOWNLOAD_URL=${DOWNLOAD_URL//\"}
DOWNLOAD_URL=${DOWNLOAD_URL/browser_download_url: /}

Expand All @@ -10,7 +12,13 @@ OUTPUT_BASENAME_WITH_POSTFIX=$OUTPUT_BASENAME.zip
curl -L $DOWNLOAD_URL -o $OUTPUT_BASENAME_WITH_POSTFIX
unzip $OUTPUT_BASENAME_WITH_POSTFIX -d $OUTPUT_BASENAME

cp $OUTPUT_BASENAME/datree /usr/local/bin
if [[ $osName == "Linux" ]]
then
sudo cp $OUTPUT_BASENAME/datree /usr/local/bin
mkdir ~/.datree
else
cp $OUTPUT_BASENAME/datree /usr/local/bin
fi

rm $OUTPUT_BASENAME_WITH_POSTFIX
rm -rf $OUTPUT_BASENAME
Expand Down

0 comments on commit a511db9

Please sign in to comment.