[fix #408] remove aio from files that need to be initialized
[rnaseq-cwl-training.git] / bin / lesson_initialize.py
1 #!/usr/bin/env python3
2
3 """Initialize a newly-created repository."""
4
5
6 import sys
7 import os
8 import shutil
9
10 BOILERPLATE = (
11     '.travis.yml',
12     'AUTHORS',
13     'CITATION',
14     'CONTRIBUTING.md',
15     'README.md',
16     '_config.yml',
17     '_episodes/01-introduction.md',
18     '_extras/about.md',
19     '_extras/discuss.md',
20     '_extras/figures.md',
21     '_extras/guide.md',
22     'index.md',
23     'reference.md',
24     'setup.md',
25 )
26
27
28 def main():
29     """Check for collisions, then create."""
30
31     # Check.
32     errors = False
33     for path in BOILERPLATE:
34         if os.path.exists(path):
35             print('Warning: {0} already exists.'.format(path), file=sys.stderr)
36             errors = True
37     if errors:
38         print('**Exiting without creating files.**', file=sys.stderr)
39         sys.exit(1)
40
41     # Create.
42     for path in BOILERPLATE:
43         shutil.copyfile(
44             "bin/boilerplate/{}".format(path),
45             path
46         )
47
48
49 if __name__ == '__main__':
50     main()