Skip to content

Commit

Permalink
use github api get latest
Browse files Browse the repository at this point in the history
  • Loading branch information
vcptr committed Jun 15, 2020
1 parent 5885c62 commit c707c39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
14 changes: 1 addition & 13 deletions uplatest.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/bin/bash

COREREPO=$1
if [[ -z $COREREPO ]]; then
COREREPO=../core
fi

if [[ ! -d $COREREPO ]]; then
echo "$0 path/to/core/gitrepo"
exit 1
fi

pushd $COREREPO
LATESTHASH=$(git rev-parse --short HEAD)
popd
LATESTHASH=$(curl --compressed https://api.github.com/repos/v2fly/v2ray-core/commits/master | jq -r .sha)
CURRHASH=$(cat ReleaseHash)

echo "Prev Rev: ${CURRHASH}, repo Hash: ${LATESTHASH}"
Expand Down
17 changes: 5 additions & 12 deletions uptag.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
#!/bin/bash

COREREPO=$1
if [[ -z $COREREPO ]]; then
COREREPO=../core
fi
LATESTTAG=$(curl --compressed https://api.github.com/repos/v2fly/v2ray-core/releases/latest | jq -r .tag_name)
CURRTAG=$(cat ReleaseTag)

if [[ ! -d $COREREPO ]]; then
echo "$0 path/to/core/gitrepo"
exit 1
if [[ -z $LATESTTAG ]]; then
echo "cant retrive latesttag"
exit 1
fi

pushd $COREREPO
LATESTTAG=$(git describe --tags)
popd
CURRTAG=$(cat ReleaseTag)

echo "Prev Rev: ${CURRTAG}, repo Hash: ${LATESTTAG}"

if [[ x${CURRTAG} == x${LATESTTAG} ]]; then
Expand Down

0 comments on commit c707c39

Please sign in to comment.