forked from ScienceParkStudyGroup/rna-seq-lesson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson_initialize.py
executable file
·50 lines (40 loc) · 970 Bytes
/
lesson_initialize.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python3
"""Initialize a newly-created repository."""
import sys
import os
import shutil
BOILERPLATE = (
'.travis.yml',
'AUTHORS',
'CITATION',
'CONTRIBUTING.md',
'README.md',
'_config.yml',
'_episodes/01-introduction.md',
'_extras/about.md',
'_extras/discuss.md',
'_extras/figures.md',
'_extras/guide.md',
'index.md',
'reference.md',
'setup.md',
)
def main():
"""Check for collisions, then create."""
# Check.
errors = False
for path in BOILERPLATE:
if os.path.exists(path):
print('Warning: {0} already exists.'.format(path), file=sys.stderr)
errors = True
if errors:
print('**Exiting without creating files.**', file=sys.stderr)
sys.exit(1)
# Create.
for path in BOILERPLATE:
shutil.copyfile(
"bin/boilerplate/{}".format(path),
path
)
if __name__ == '__main__':
main()