Skip to content

Commit df68dc2

Browse files
committed
fix: bug in readme_location
use os.getcwd() instead of specifying Path relative to script's location
1 parent 87fddc2 commit df68dc2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

readme_coverage_badger/__main__.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,20 +176,19 @@ def get_badge(total, colour=DEFAULT_COLOUR):
176176
return shields_badge
177177

178178

179-
def readme_location(filename: Union[str, str] = "README.md") -> Path:
179+
def readme_location(filename: Union[str, str] = "README.md") -> str:
180180
"""Path to the README file"""
181-
current_dir = Path(__file__).resolve().parent
182-
parent_dir = current_dir.parents[0]
183-
readme_file = parent_dir / filename
181+
current_dir = os.getcwd()
182+
readme_file = os.path.join(current_dir, filename)
184183

185184
return readme_file
186185

187186

188-
def update_coverage_badge(readme: Path, cov_string: str, plain: Optional[bool] = False):
187+
def update_coverage_badge(readme: str, cov_string: str, plain: Optional[bool] = False):
189188
"""update coverage badge in a readme file
190189
191190
Args:
192-
readme (Path): readme file where we'll perform in-place substitution
191+
readme (str): readme file where we'll perform in-place substitution
193192
cov_string (str): total test coverage
194193
plain (bool): whether to use plain colour or not
195194
"""

0 commit comments

Comments
 (0)