Skip to content

Commit

Permalink
feat($loguru): change data output directory
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymillergh committed Aug 30, 2022
1 parent 4e1cb15 commit 06ff16f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ WORKDIR /app
COPY . .

RUN pwd
RUN ls -R -l -h
RUN ls -l -h

# Run the executable
ENTRYPOINT ["python", "-m", "python_boilerplate"]
Expand Down
10 changes: 6 additions & 4 deletions python_boilerplate/function_collection.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import os
from pathlib import Path

_current_file = os.path.abspath(__file__)
_PROJECT_ROOT = Path.cwd().parent
_CURRENT_FILE_PATH = os.path.abspath(__file__)


def get_root_path() -> str:
"""
Get the root path of the project.
"""
return os.path.dirname(_current_file)
return os.path.dirname(_CURRENT_FILE_PATH)


def get_data_dir() -> str:
"""
Get the data directory of the project.
"""
data_dir = f"{get_root_path()}/data"
data_dir = f"{_PROJECT_ROOT.__str__()}/data"
os.makedirs(data_dir, exist_ok=True)
return data_dir

Expand All @@ -30,7 +32,7 @@ def get_module_name() -> str:
"""
Get the name of the current module.
"""
path_list = _current_file.split(os.path.sep)
path_list = _CURRENT_FILE_PATH.split(os.path.sep)
return path_list[len(path_list) - 2]


Expand Down
File renamed without changes.

0 comments on commit 06ff16f

Please sign in to comment.