Skip to content

Commit

Permalink
Update zip_deploy.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeanon committed Feb 19, 2024
1 parent 842f55d commit 3f75633
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions moonraker/components/update_manager/zip_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
# This file may be distributed under the terms of the GNU GPLv3 license.

from __future__ import annotations
import os.path
import pathlib
import shutil
import zipfile
import logging
from stat import S_IXUSR
from .app_deploy import AppDeploy
from .common import Channel, AppType
from ...utils import source_info
Expand Down Expand Up @@ -310,8 +312,11 @@ def _extract_release(
self.path.mkdir()
with zipfile.ZipFile(release_file) as zf:
for zip_entry in zf.filelist:
dest = pathlib.Path(zf.extract(zip_entry, str(self.path)))
dest.chmod((zip_entry.external_attr >> 16) & 0o777)
extracted_path = zf.extract(zip_entry, str(self.path))
if os.path.isfile(extracted_path):
unix_attributes = zip_entry.external_attr >> 16
if unix_attributes & S_IXUSR:
os.chmod(extracted_path, os.stat(extracted_path).st_mode | S_IXUSR)

Check warning on line 319 in moonraker/components/update_manager/zip_deploy.py

View workflow job for this annotation

GitHub Actions / lint-python-code

line too long (91 > 88 characters)
# Move temporary files back into
for src_path in persist_dir.iterdir():
dest_path = self.path.joinpath(src_path.name)
Expand Down

0 comments on commit 3f75633

Please sign in to comment.