Skip to content

Instantly share code, notes, and snippets.

@imaami
Created February 28, 2025 17:30
Show Gist options
  • Save imaami/89335ea3211ffa088839e4cd154fe9e6 to your computer and use it in GitHub Desktop.
Save imaami/89335ea3211ffa088839e4cd154fe9e6 to your computer and use it in GitHub Desktop.
Generate a list of GitHub caching keys from a semantic version
#!/usr/bin/env bash
vsplit() {
local k="$1" r
while [[ "$k" != "$r" ]]; do
echo "$k"; r="$k"
k="${k%?${k##*[0-9][.+-]}}"
done
}
vsplit "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment