1
1
"""
2
2
This script takes tab delimited input file like so and automatically
3
- creates the folder structure along with empty README files, per the contributing
4
- guidelines. If you copy-paste from Google sheets, it will automatically add
5
- tabs.
3
+ creates the folder structure for readings along with empty README files, per the
4
+ contributing guidelines. If you copy-paste from Google sheets, it will
5
+ automatically add tabs.
6
+
7
+ Sorry, didn't feel like handling labs, so you just need to delete the lab folder
8
+ when it gets created or rename it manually.
6
9
7
10
* Copy-paste the file below into `outline.txt` (too lazy to parameterize this
8
11
script) in the directory of the module that you want to use, i.e.,
9
12
`module5-testing/outline.txt`
10
13
* cd to the correct directory (this step is important for the working directory
11
14
to be correct)
12
- * Run `python ../make_structure.py`
15
+ * Run `python3 ../make_structure.py` (not python2)
13
16
* Enjoy your created structure
14
17
15
18
1 What is a test?
@@ -35,13 +38,10 @@ def main():
35
38
# Convert casing: "Example code" to "example-code"
36
39
normalized_chapter_name = chapter_name .replace (' ' , '-' ).lower ()
37
40
# Make directories
38
- subprocess .run (["mkdir" , "-p" , os .path .join (
39
- chapter_num ,
40
- os .getcwd (),
41
- normalized_chapter_name )])
41
+ dir_name = chapter_num .strip () + '-' + normalized_chapter_name .strip ()
42
+ subprocess .run (["mkdir" , "-p" , os .path .join (os .getcwd (), dir_name )])
42
43
# Make README files
43
- subprocess .run (["touch" , os .path .join (os .getcwd (), normalized_chapter_name ,
44
- "README.md" )])
44
+ subprocess .run (["touch" , os .path .join (os .getcwd (), dir_name , "README.md" )])
45
45
46
46
if __name__ == '__main__' :
47
47
main ()
0 commit comments