Created
January 2, 2025 13:01
-
-
Save Fiewor/aeaba8f68df0778ac68596012e6cb639 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/bash | |
| read -p "Open frontend codebase? " REPLY | |
| case "$REPLY" in | |
| [yY] | [yY][eE][sS]) | |
| echo "Opening frontend codebase..." | |
| cd ./ai-grader && code . | |
| sleep .5 | |
| read -p "Open the backend codebase too? " REPLY | |
| case "$REPLY" in | |
| [yY] | [yY][eE][sS]) | |
| echo "Opening backend codebase..." | |
| cd ../ai-grader-backend && code . | |
| sleep 1 | |
| echo "Done. Happy Hacking!" | |
| ;; | |
| [nN] | [nN][oO]) | |
| echo "Alright. Happy Hacking!" | |
| ;; | |
| *) | |
| echo "Please enter y/yes or n/no" | |
| ;; | |
| esac | |
| ;; | |
| [nN] | [nN][oO]) | |
| read -p "Open just the backend codebase? " REPLY | |
| case "$REPLY" in | |
| [yY] | [yY][eE][sS]) | |
| sleep .5 | |
| echo "Opening backend codebase..." | |
| cd ./ai-grader-backend && code . | |
| sleep 1 | |
| echo "Done. Happy Hacking!" | |
| ;; | |
| [nN] | [nN][oO]) | |
| sleep .5 | |
| echo "Alright. Happy Hacking!" | |
| ;; | |
| *) | |
| echo "Please enter y/yes or n/no" | |
| ;; | |
| esac | |
| ;; | |
| *) | |
| # default answer if no expected reply is given | |
| echo "Please enter y/yes or n/no" | |
| ;; | |
| esac | |
| # if ["$REPLY" == "yes"] | |
| # then | |
| # echo "Opening frontend codebase" | |
| # cd ./ai-grader && code . | |
| # else | |
| # echo "Open just the backend codebase?" | |
| # if ["$REPLY" == "yes"] | |
| # then | |
| # echo "Opening backend codebase" | |
| # cd ./ai-grader-backend && code . | |
| # else | |
| # echo "Alright. Happy Hacking!" | |
| # fi | |
| # modify above code into a function for opening any file | |
| # function open(){ | |
| # # check if code file exists | |
| # FILE = $1 | |
| # if [-d "$FILE"] | |
| # then | |
| # echo "" | |
| # else | |
| # echo "" | |
| # fi | |
| # # if it exists, open it | |
| # # if not, echo something | |
| # } | |
| # open ai-Grader |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment