Skip to content

Commit

Permalink
Fix for npm-audit when package.json in root
Browse files Browse the repository at this point in the history
```
>>> os.path.split("package.json")
('', 'package.json')
>>> os.path.split("x/y/package.json")
('x/y', 'package.json')
```

https://github.com/brave/brave-core-crx-packager/actions/runs/5339275564/jobs/9677773649
  • Loading branch information
bcaller committed Jun 21, 2023
1 parent 9366598 commit db83e27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/npm-audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def main():
for lock_path in changed_lock_files:
with open(lock_path) as lock_file:
lock_file_lines = lock_file.readlines()
cwd = path.split(lock_path)[0]
cwd = path.split(lock_path)[0] or '.'
stdout = subprocess.run(
["npm", "audit", "--package-lock-only", "--json"],
cwd=cwd,
Expand All @@ -37,4 +37,4 @@ def main():


if __name__ == "__main__":
main()
main()

0 comments on commit db83e27

Please sign in to comment.