We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8595137 commit 4a7d874Copy full SHA for 4a7d874
autoupdater.sh
@@ -2,10 +2,10 @@
2
clear
3
4
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
5
-changed=0
+REMOTE_HASH="$( curl -s https://api.github.com/repos/Sekiphp/useful-scripts/commits/master | grep -m1 -o -P '(?<="sha": ")[^"]+' )"
6
+LOCAL_HASH="$( git rev-parse HEAD)"
7
-git -C "$DIR" remote update && git -C "$DIR" status -uno | grep -q 'Your branch is behind' && changed=1
8
-if [ $changed = 0 ];
+if [ "$REMOTE_HASH" == "$LOCAL_HASH" ];
9
then
10
echo "Useful-scripts is up to date!"
11
else
@@ -21,7 +21,7 @@ else
21
22
if [[ "$cmd" = "Y" ]];
23
24
- git -C "$DIR" pull
+ git -C "$DIR" fetch
25
echo "Updated successfully";
26
fi
27
0 commit comments