Skip to content

Commit

Permalink
perf(build): In prod, during packaging no need to modify perm of files
Browse files Browse the repository at this point in the history
Usually in macos, we have different uid/gid than any linux system
So, in development, it was causing issue.
That's why the permission modification was added
  - #1925

But, in prod it's not required.
So, we can just modify permission, when developer mode is enabled
  • Loading branch information
tanmoysrt committed Jan 1, 2025
1 parent 91f01a4 commit 163ab96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"libsm",
"libxext",
"supervisord",
"vimrc"
"vimrc",
"uid"
],
"allowCompoundWords": true,
"ignorePaths": [
Expand Down
5 changes: 4 additions & 1 deletion press/press/doctype/deploy_candidate/deploy_candidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,10 @@ def fix_content_permission(tarinfo):

tmp_file_path = tempfile.mkstemp(suffix=".tar.gz")[1]
with tarfile.open(tmp_file_path, "w:gz", compresslevel=5) as tar:
tar.add(self.build_directory, arcname=".", filter=fix_content_permission)
if frappe.conf.developer_mode:
tar.add(self.build_directory, arcname=".", filter=fix_content_permission)

Check warning on line 544 in press/press/doctype/deploy_candidate/deploy_candidate.py

View check run for this annotation

Codecov / codecov/patch

press/press/doctype/deploy_candidate/deploy_candidate.py#L542-L544

Added lines #L542 - L544 were not covered by tests
else:
tar.add(self.build_directory, arcname=".")

Check warning on line 546 in press/press/doctype/deploy_candidate/deploy_candidate.py

View check run for this annotation

Codecov / codecov/patch

press/press/doctype/deploy_candidate/deploy_candidate.py#L546

Added line #L546 was not covered by tests

step.status = "Success"
step.duration = get_duration(start_time)
Expand Down

0 comments on commit 163ab96

Please sign in to comment.