Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extralit-server/src/extralit_server/_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def _create_statics_folder(path_from):
BASE_URL_VAR_NAME = "@@baseUrl@@"
temp_dir = tempfile.mkdtemp()
new_folder = shutil.copytree(path_from, temp_dir + "/statics")
base_url = helpers.remove_suffix(settings.base_url or "", suffix="/")
base_url = (settings.base_url or "").removesuffix("/")
for extension in ["*.js", "*.html"]:
for file in glob.glob(
f"{new_folder}/**/{extension}",
Expand Down
7 changes: 1 addition & 6 deletions extralit-server/src/extralit_server/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,7 @@ async def create_s3_client() -> "S3Client":
return s3_client


def remove_suffix(text: str, suffix: str):
# TODO Move where is used
"""Give a text, removes suffix substring from it"""
if text.endswith(suffix):
return text[: -len(suffix)]
return text



def replace_string_in_file(filename: str, string: str, replace_by: str, encoding: str = "utf-8"):
Expand Down
Loading