Skip to content

Commit 565a8e3

Browse files
Development Commit
1 parent dc199e5 commit 565a8e3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/registry/index.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@ mush_registry_index_update()
1414

1515
if [ -f "${MUSH_REGISTRY_CACHE}" ]; then
1616
while read -r line; do
17-
echo "Entry cache: ${line}"
17+
#echo "Entry cache: ${line}"
1818
[ -z "${line}" ] && continue
1919
[ "${line:0:1}" = "#" ] && continue
20+
local packages_file_url="$(echo "${line}" | awk '{print $1}')"
21+
local packages_cache_hash="$(echo "${line}" | awk '{print $2}')"
22+
local packages_hash="$(curl -I -s -L "${packages_file_url}" | grep -i ETag | awk '{print $2}' | tr -d '"')"
23+
if [ "${packages_cache_hash}" != "${packages_hash}" ]; then
24+
rm -fr "${MUSH_HOME}/registry/index" && true
25+
fi
2026
done < "${MUSH_REGISTRY_CACHE}"
2127
fi
2228

0 commit comments

Comments
 (0)