Change submodule and master-based-workflow setup#381
Change submodule and master-based-workflow setup#381dportil wants to merge 2 commits intoeficode-academy:masterfrom
Conversation
The submodule /exercise directory does not have a repository. So git commands executed in /exercise would effect the parent git-katas repo. Added the make-exercise-repo utility to the setup.sh to create an empty repo in /exercise. Which encapsulates it.
The submodule /exercise directory does not have a repository. So git commands executed in /exercise would effect the parent git-katas repo. Added the make-exercise-repo utility to the setup.sh to create an empty repo in /exercise. Which encapsulates it.
WalkthroughThe setup scripts in two directories have been updated to replace manual directory creation and navigation steps with a single call to a Changes
Estimated code review effort1 (~2 minutes) Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
submodules/setup.sh (2)
7-11: Redundant cleanup –exercise/is removed twice
make-exercise-repoalready performsrm -rf exercise/.
Keeping the standalonerm -rf exerciseintroduces needless I/O and makes the intent less clear.-# First cleanup if there is an old exercise folder -rm -rf exercise - -# Create exercise folder & go there -make-exercise-repo +# Create exercise folder & go there (make-exercise-repo handles cleanup itself) +make-exercise-repo
1-5: Harden the script with strict-mode flagsConsider adding the usual bash safety flags right after the shebang:
set -euo pipefailThis causes the script to abort on the first error, on unset variables, and on pipe failures—especially useful in teaching katas where users may modify the script.
master-based-workflow/setup.sh (2)
4-7: Duplicaterm -rf exercisecall
make-exercise-repoalready deletes any pre-existingexercise/folder.
Removing the extra call keeps the setup concise and avoids unnecessary disk work.-rm -rf exercise - -make-exercise-repo +make-exercise-repo # function already wipes old exercise repo
1-3: Enable strict mode for safer executionAdd bash strict-mode flags to fail fast on errors and undefined variables:
set -euo pipefailThis is particularly helpful in workflow-oriented scripts where an unnoticed failure can derail the subsequent learner steps.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
master-based-workflow/setup.sh(1 hunks)submodules/setup.sh(1 hunks)
🧬 Code Graph Analysis (2)
submodules/setup.sh (1)
utils/make-exercise-repo.sh (1)
make-exercise-repo(2-12)
master-based-workflow/setup.sh (1)
utils/make-exercise-repo.sh (1)
make-exercise-repo(2-12)
🧰 Additional context used
🧬 Code Graph Analysis (2)
submodules/setup.sh (1)
utils/make-exercise-repo.sh (1)
make-exercise-repo(2-12)
master-based-workflow/setup.sh (1)
utils/make-exercise-repo.sh (1)
make-exercise-repo(2-12)
The submodule and master-based-workflow /exercise directories do not have a repository. So git commands executed in /exercise would effect the parent git-katas repo.
Replaced mkdir with the make-exercise-repo utility in the setup.sh files. This creates an empty repo in /exercise and protects the parent repo.
Summary by CodeRabbit