]> saetta.ns0.it Git - nix/pkgs/commitdiff
update_rev: aggiornamento diretto dell'hash nel file.
authorAndrea Zagli <andrea.zagli@yahoo.com>
Fri, 9 Sep 2022 06:56:11 +0000 (08:56 +0200)
committerAndrea Zagli <andrea.zagli@yahoo.com>
Fri, 9 Sep 2022 07:00:17 +0000 (09:00 +0200)
update_rev.sh

index dea66c3f6f9dfeda8fe05862afd422c8371c3f3a..ebe6459ef0f5e879ce1e6423029da034c16bb9fb 100755 (executable)
@@ -1,4 +1,6 @@
 #!/bin/bash
 
 url=$(awk '/url/ {gsub("\"", "", $3); gsub(";", "", $3); print $3}' $1)
-git ls-remote $url refs/heads/$2 | awk '{print $1}'
+sha=$(git ls-remote $url refs/heads/$2 | awk '{print $1}')
+
+sed -i -e "s/rev[ ]*=[ ]*\".*\"/rev = \"$sha\"/g" $1