Passed
Push — main ( fa2423...891932 )
by J
01:24
created

create_readme   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 12
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A create_readme() 0 8 2
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
4
from pathlib import Path
5
import sys
6
7
8
def create_readme():
9
    """Create a README for the new project"""
10
    proj_name = sys.argv[2]
11
    proj_path = Path(proj_name)
12
    readme_path = proj_path / "README.md"
13
    with readme_path.open("w+", encoding="utf-8") as readme:
14
        readme.write(f"# {proj_name}\n\n")
15
        readme.seek(0)
16
17
18
if __name__ == "__main__":
19
    create_readme()
20