Skip to content

Commit

Permalink
Warn on broken symlinks instead of error (#294)
Browse files Browse the repository at this point in the history
Bazel creates broken symlinks in the build folder.

Fixes #293.
  • Loading branch information
calcmogul authored Nov 14, 2024
1 parent b98970d commit 8458230
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions wpiformat/wpiformat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,11 @@ def main():
# Throw an error if any files or directories don't exist
for f in files:
if not os.path.exists(f):
print(f"error: {f}: No such file or directory")
sys.exit(1)
if not os.path.islink(f):
print(f"error: {f}: No such file or directory")
sys.exit(1)
else:
print(f"warning: {f}: Broken symlink")

# Convert relative paths of files to absolute paths
files = [os.path.abspath(name) for name in files]
Expand Down

0 comments on commit 8458230

Please sign in to comment.