2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-23 07:08:23 +00:00

Merge pull request #1344 from gavindsouza/dummy-release-trigger-2

fix: Use subscript instead of method for regex
This commit is contained in:
gavin 2022-07-30 01:23:11 +05:30 committed by GitHub
commit 1ec17e40f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -250,7 +250,7 @@ def get_app_name(bench_path: str, folder_name: str) -> str:
if not app_name: if not app_name:
# retrieve app name from setup.py as fallback # retrieve app name from setup.py as fallback
with open(setup_py_path, "rb") as f: with open(setup_py_path, "rb") as f:
app_name = re.search(r'name\s*=\s*[\'"](.*)[\'"]', f.read().decode("utf-8")).group(1) app_name = re.search(r'name\s*=\s*[\'"](.*)[\'"]', f.read().decode("utf-8"))[1]
if app_name and folder_name != app_name: if app_name and folder_name != app_name:
os.rename(os.path.join(apps_path, folder_name), os.path.join(apps_path, app_name)) os.rename(os.path.join(apps_path, folder_name), os.path.join(apps_path, app_name))