File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ import os
2+ from exercise_utils .file import create_or_update_file , append_to_file
3+ from exercise_utils .git import init , add , commit
4+
5+ __requires_git__ = True
6+ __requires_github__ = False
7+
8+ def download (verbose : bool ):
9+ os .makedirs ("sandbox" , exist_ok = True )
10+ os .chdir ("sandbox" )
11+ init (verbose )
12+
13+ create_or_update_file ("README.md" , "# Ignore File Hands-on\n " )
14+ add (["README.md" ], verbose )
15+ commit ("chore: init README" , verbose )
16+
17+ create_or_update_file (".gitignore" , "logs/\n *.tmp\n " )
18+ add ([".gitignore" ], verbose )
19+ commit ("chore: add .gitignore for logs/ and *.tmp" , verbose )
20+
21+ create_or_update_file ("notes.txt" , "keep me tracked\n " )
22+ add (["notes.txt" ], verbose )
23+ commit ("feat: add tracked notes.txt" , verbose )
24+
25+ os .makedirs ("logs" , exist_ok = True )
26+ create_or_update_file ("logs/run.log" , "this should be ignored\n " )
27+ create_or_update_file ("temp.tmp" , "also ignored by pattern\n " )
28+
29+ append_to_file ("notes.txt" , "new line not committed yet\n " )
You can’t perform that action at this time.
0 commit comments