Skip to content

Commit

Permalink
fix: fix scan mutil refs
Browse files Browse the repository at this point in the history
Signed-off-by: loonghao <[email protected]>
  • Loading branch information
loonghao committed May 8, 2024
1 parent c91ec8e commit 1b19ddc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
- name: Generate changelog
id: changelog
uses: jaywcjlove/changelog-generator@main
if: steps.get_tag_name.outputs.successful
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
filter-author: (|dependabot|renovate\\[bot\\]|dependabot\\[bot\\]|Renovate Bot)
Expand All @@ -62,7 +61,6 @@ jobs:
## Unknown
{{__unknown__}}
- uses: ncipollo/release-action@v1
if: steps.make_maya_mod.outputs.successful
with:
artifacts: ".zip/maya_umbrella-*.zip"
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
Expand Down
11 changes: 8 additions & 3 deletions maya_umbrella/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(self, output_path=None, env=None):
self.defender = None
self.output_path = output_path
self._failed_files = []
self._reference_files = []
self._fixed_files = []
# Custom env.
self._env = env or {
Expand All @@ -63,6 +64,9 @@ def scan_files_from_list(self, files):
self.defender = defender
for maya_file in files:
self._fix(maya_file)
while len(self._reference_files) > 0:
for ref in self._reference_files:
self._fix(ref)
return self._fixed_files

def scan_files_from_file(self, text_file):
Expand Down Expand Up @@ -96,6 +100,7 @@ def _fix(self, maya_file):
shutil.copy2(maya_file, backup_path)
cmds.file(s=True, f=True)
self._fixed_files.append(maya_file)
cmds.file(new=True, force=True)
for ref in self.defender.collector.infected_reference_files:
self._fix(ref)
self._reference_files.extend(self.defender.collector.infected_reference_files)
if maya_file in self._reference_files:
self._reference_files.remove(maya_file)
cmds.file(new=True, force=True)

0 comments on commit 1b19ddc

Please sign in to comment.