Updated -r flag to be more featureful

This commit is contained in:
z3rOR0ne 2022-07-27 11:09:23 -07:00
parent 4b49ffad93
commit eb1c67002e

View file

@ -223,19 +223,19 @@ else
tput bold & tput setaf 7
if [[ $revert == "y" || $revert == "yes" ]] ; then
commitarray=($(git log -5 | grep commit | sed 's/commit//g'));
verbosecommits=$(git shortlog -5 --reverse | sed 1d);
commitarray=($(git log -6 | grep commit | sed 's/commit//g'));
verbosecommits=$(git shortlog -6 --reverse | sed 1d);
numcommits=5
numcommits=6
for ((i = 0; i < numcommits; i++)) do
j=$(echo ${i} + 1 | bc)
nextcommit=$(echo "${verbosecommits}" | head -n $j | tail -n 1)
echo -e "${i})${nextcommit}"
echo -e "${i}) ${commitarray[$i]}${nextcommit}"
done
read -e -r -p "${txtwhite}Choose commit to revert back to: ${txtyellow}" version
echo "version you wish to go back to: ${commitarray[$version]}"
echo "${txtblue}Reverting back to version: ${txtyellow}${commitarray[$version]}"
# Reset output style
tput bold & tput setaf 7