Created
November 21, 2020 14:48
-
-
Save nevans/aaa80ffdfda598577b930269d4dd274d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eo pipefail | |
bundle show | | |
grep -v '^Gems' | | |
sed 's/^ \* \|(\|)//g' | | |
while read -r line; do | |
gemname=$(echo "$line" | cut -f1 -d" ") | |
version=$(echo "$line" | cut -f2 -d" ") | |
gitsha1=$(echo "$line" | cut -f3 -d" ") | |
if [ -n "$gitsha1" ]; then | |
cd "$(bundle show --paths "$gemname")"; | |
date="$(git log -1 --format=%cd --date=short)" | |
version="$version-$gitsha1" | |
cd - >/dev/null || exit | |
else | |
date=$(gem specification "$gemname" -v "$version" | | |
awk '/^date:/ { print $2 }') | |
fi | |
printf "%s %-36s %s\n" "$date" "$gemname" "$version" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eo pipefail | |
bundle list | | |
grep '^ \*' | | |
sed 's/^ \* \|(\|)//g' | | |
while read -r line; do | |
gemname=$(echo "$line" | cut -f1 -d" ") | |
version=$(echo "$line" | cut -f2 -d" ") | |
gitsha1=$(echo "$line" | cut -f3 -d" ") | |
if [ -n "$gitsha1" ]; then | |
cd "$(bundle info --path "$gemname")"; | |
date="$(git log -1 --format=%cd --date=short)" | |
version="$version-$gitsha1" | |
cd - >/dev/null || exit | |
else | |
date=$(bundle exec gem specification "$gemname" -v "$version" | | |
awk '/^date:/ { print $2 }') | |
fi | |
printf "%s %-36s %s\n" "$date" "$gemname" "$version" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment