-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Format: <chapter name><SPACE><command to get to that chapter> | ||
chapters=( | ||
"branches git switch -f branches-explained" | ||
"push/pull git switch -f working-with-others" | ||
"log git reset --hard @ && git fetch -q && git switch -f history" | ||
"cherry-pick git switch -f --detach CHAPTER_INTERACTIVE_REBASE_FOLLOW" | ||
) | ||
|
||
while true; do | ||
printf "Chapters you can jump to (you won't be collecting nuggits ;)):\n" | ||
for i in "${!chapters[@]}"; do | ||
chapter_name="$(echo "${chapters["$i"]}" | cut -d " " -f 1)" | ||
printf "%s)\t%s\n" "$i" "$chapter_name" | ||
done | ||
printf "q)\tquit\n\n" | ||
read -r -p "Enter chapter to jump to: " c | ||
if [ "$c" = q ]; then | ||
exit | ||
fi | ||
if [ "$c" -lt "${#chapters[@]}" ] && [ "$c" -ge 0 ]; then | ||
goto_chapter="$(echo "${chapters["$c"]}" | cut -d " " -f 2-)" | ||
break | ||
fi | ||
printf "\n\nInvalid input!\n" | ||
done | ||
|
||
eval "$goto_chapter" |
This file contains 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