Skip to content

Commit 6028831

Browse files
0.0.6
1 parent 108b691 commit 6028831

File tree

6 files changed

+13
-1
lines changed

6 files changed

+13
-1
lines changed

snok/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""snok"""
22

3-
__version__ = "0.0.5"
3+
__version__ = "0.0.6"

snok/services/new.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,20 @@ def _render_content_directory(
3535
file_path = os.path.join(root, file)
3636
relative_path = os.path.relpath(file_path, source_dir)
3737
output_path = os.path.join(output_dir, relative_path)
38+
3839
if output_path.endswith("_pyproject.toml"):
3940
output_path = output_path.replace(
4041
"_pyproject.toml", "pyproject.toml"
4142
)
43+
44+
_basename = os.path.basename(relative_path)
45+
if _basename.startswith("_.") and not _basename.endswith(".py"):
46+
_newbasename = _basename.replace("_.", ".")
47+
output_path = os.path.join(
48+
output_dir,
49+
relative_path.replace(_basename, _newbasename),
50+
)
51+
4252
self._render_content_file(
4353
name=name,
4454
desc=desc,
File renamed without changes.

tests/test_cli_new.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def test_new_package(cli_runner: CliRunner, setup_test_project_dir: str) -> None
1212
["new", "test_package", "-o", setup_test_project_dir],
1313
)
1414
assert response.exit_code == 0
15+
print(os.listdir(setup_test_project_dir))
1516
# assert the output directory exists
1617
for path in [
1718
f"{setup_test_project_dir}/test_package",
@@ -20,6 +21,7 @@ def test_new_package(cli_runner: CliRunner, setup_test_project_dir: str) -> None
2021
f"{setup_test_project_dir}/README.md",
2122
f"{setup_test_project_dir}/setup.cfg",
2223
f"{setup_test_project_dir}/pyproject.toml",
24+
f"{setup_test_project_dir}/.gitignore",
2325
f"{setup_test_project_dir}/test_package/__init__.py",
2426
f"{setup_test_project_dir}/test_package/main.py",
2527
f"{setup_test_project_dir}/tests/__init__.py",

0 commit comments

Comments
 (0)