Skip to content

Commit

Permalink
path length < 200 limit
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasc-ubc committed Oct 28, 2024
1 parent 71eab52 commit d964c34
Show file tree
Hide file tree
Showing 43 changed files with 32 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/check-path-length.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# .github/workflows/check-path-length.yml
name: Check Path Length
name: Check Path Length (200 limit)

on:
push:
Expand All @@ -20,12 +20,14 @@ jobs:
# Find all files in the repository and check their path lengths
too_long_paths=0
# Loop through each file path found by find
IFS=$'\n' # Set Internal Field Separator to newline to handle spaces in filenames
for file in $(find . -type f); do
length=${#file}
if (( length > MAX_LENGTH )); then
echo "Path too long: $file ($length characters)"
too_long_paths=$((too_long_paths + 1))
fi
length=${#file}
if (( length > MAX_LENGTH )); then
echo "Path too long: $file ($length characters)"
too_long_paths=$((too_long_paths + 1))
fi
done
if (( too_long_paths > 0 )); then
Expand Down
24 changes: 24 additions & 0 deletions check_path_lengths
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Set the maximum allowed length
MAX_LENGTH=200
# Find all files in the repository and check their path lengths
too_long_paths=0


# Loop through each file path found by find
IFS=$'\n' # Set Internal Field Separator to newline to handle spaces in filenames
for file in $(find . -type f); do
length=${#file}
if (( length > MAX_LENGTH )); then
echo "Path too long: $file ($length characters)"
too_long_paths=$((too_long_paths + 1))
fi
done

echo "Files too long: $too_long_paths"
if (( too_long_paths > 0 )); then
echo "Error: Found $too_long_paths file paths longer than $MAX_LENGTH characters."
exit 1
else
echo "All file paths are within the $MAX_LENGTH character limit."
fi

0 comments on commit d964c34

Please sign in to comment.