File tree Expand file tree Collapse file tree 2 files changed +32
-3
lines changed Expand file tree Collapse file tree 2 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,12 @@ pushd "$TMPDIR" > /dev/null
12
12
mkdir -p complexity
13
13
pushd complexity > /dev/null;
14
14
distro=$( if [[ " $( uname -s) " == " Darwin" ]]; then echo " osx" ; else echo " linux" ; fi)
15
- arch=$( uname -m)
16
15
if [ -n " $1 " ]
17
16
then
18
17
echo " Will download and install v$1 "
19
- curl -sSL --fail -o complexity.zip " https://github.com/apiiro/code-complexity/releases/download/v$1 /complexity-$1 -$distro - $arch .zip"
18
+ curl -sSL --fail -o complexity.zip " https://github.com/apiiro/code-complexity/releases/download/v$1 /complexity-$1 -$distro .zip"
20
19
else
21
- curl -s --fail https://api.github.com/repos/apiiro/code-complexity/releases/latest | grep " browser_download_url.*$distro - $arch .zip" | cut -d : -f 2,3 | tr -d \" | xargs curl -sSL --fail -o complexity.zip
20
+ curl -s --fail https://api.github.com/repos/apiiro/code-complexity/releases/latest | grep " browser_download_url.*$distro .zip" | cut -d : -f 2,3 | tr -d \" | xargs curl -sSL --fail -o complexity.zip
22
21
fi
23
22
unzip complexity.zip
24
23
chmod +x complexity-*
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # USAGE: ./install.sh [version]
4
+ # will install the latest tool executable to your /usr/local/bin
5
+
6
+ set -e
7
+
8
+ echo " Installing..."
9
+
10
+ TMPDIR=${TMPDIR:- " /tmp" }
11
+ pushd " $TMPDIR " > /dev/null
12
+ mkdir -p complexity
13
+ pushd complexity > /dev/null;
14
+ distro=$( if [[ " $( uname -s) " == " Darwin" ]]; then echo " osx" ; else echo " linux" ; fi)
15
+ arch=$( uname -m)
16
+ if [ -n " $1 " ]
17
+ then
18
+ echo " Will download and install v$1 "
19
+ curl -sSL --fail -o complexity.zip " https://github.com/apiiro/code-complexity/releases/download/v$1 /complexity-$1 -$distro -$arch .zip"
20
+ else
21
+ curl -s --fail https://api.github.com/repos/apiiro/code-complexity/releases/latest | grep " browser_download_url.*$distro -$arch .zip" | cut -d : -f 2,3 | tr -d \" | xargs curl -sSL --fail -o complexity.zip
22
+ fi
23
+ unzip complexity.zip
24
+ chmod +x complexity-*
25
+ cp -f complexity-* /usr/local/bin/complexity
26
+ popd > /dev/null
27
+ rm -rf complexity
28
+ popd > /dev/null
29
+
30
+ echo " Done: $( complexity -v) "
You can’t perform that action at this time.
0 commit comments