File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,15 @@ URL=https://github.com/github/codeql-cli-binaries/releases
4
4
LATEST_VERSION=$( curl -L -s -H ' Accept: application/json' $URL /latest | sed -e ' s/.*"tag_name":"\([^"]*\)".*/\1/' )
5
5
CURRENT_VERSION=v$( codeql version 2> /dev/null | sed -ne ' s/.*release \([0-9.]*\)\./\1/p' )
6
6
if [[ $CURRENT_VERSION != $LATEST_VERSION ]]; then
7
- curl -fSqL -o /tmp/codeql.zip $URL /download/$LATEST_VERSION /codeql-linux64.zip
8
- unzip /tmp/codeql.zip -qd /opt
9
- rm /tmp/codeql.zip
7
+ if [[ $UID != 0 ]]; then
8
+ echo " update required, please run this script with sudo:"
9
+ echo " sudo $0 "
10
+ exit 1
11
+ fi
12
+ ZIP=$( mktemp codeql.XXXX.zip)
13
+ curl -fSqL -o $ZIP $URL /download/$LATEST_VERSION /codeql-linux64.zip
14
+ unzip -q $ZIP -d /opt
15
+ rm $ZIP
10
16
ln -sf /opt/codeql/codeql /usr/local/bin/codeql
11
17
echo installed version $LATEST_VERSION
12
18
else
You can’t perform that action at this time.
0 commit comments