-
Notifications
You must be signed in to change notification settings - Fork 25
Implement hands-on checkout commits #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
woojiahao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments. Could you also remove the comments for the steps. They aren't necessary.
| __requires_github__ = False | ||
|
|
||
| def download(verbose: bool): | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this comment
| target_dir = Path("things") | ||
|
|
||
| # Clean existing sandbox if re-downloading | ||
| if target_dir.exists(): | ||
| import shutil | ||
| shutil.rmtree(target_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This already happens via the app: https://git-mastery.github.io/developers/docs/architecture/download-workflow/#hands-on-download
So this check can be omitted
| # Create sandbox folder | ||
| target_dir.mkdir() | ||
| os.chdir(target_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think conventionally, os.makedirs would be more consistent with the existing code
| with open("fruits.txt", "w") as f: | ||
| f.write("apples\nbananas\ncherries\ndragon fruits\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the given create_or_update_file utility function
| with open("fruits.txt", "a") as f: | ||
| f.write("elderberries\nfigs\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the given append_file utility function
| with open("colours.txt", "w") as f: | ||
| f.write("a file for colours\n") | ||
| with open("shapes.txt", "w") as f: | ||
| f.write("a file for shapes\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the given create_or_update_file utility function
| with open("fruits.txt", "w") as f: | ||
| f.write("apples, apricots\nbananas\nblueberries\ncherries\ndragon fruits\nfigs\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the given create_or_update utility function
| with open("colours.txt", "a") as f: | ||
| f.write("blue\nred\nwhite\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use append_file
| with open("shapes.txt", "a") as f: | ||
| f.write("circle\noval\nrectangle\nsquare\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use append_file
Exercise Review
Exercise Discussion
#106
Checklist
Git-Masteryorganization, have you created a request for it?repo-smithto validate the exercise grading scheme?test-download.sh?git-autograder?app?