Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusjunges committed Oct 5, 2024
1 parent 310a310 commit e694e75
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ weight: 5
---

All notable changes to laravel kafka are documented on [GitHub](https://github.com/mateusjunges/laravel-kafka/blob/v2.x/CHANGELOG.md).

```+parse
<x-newsletter />
```
23 changes: 23 additions & 0 deletions rename.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Function to rename files by removing the numeric prefix
rename_files() {
for file in "$1"/*; do
if [ -d "$file" ]; then
# If the file is a directory, recursively call the function
rename_files "$file"
elif [ -f "$file" ]; then
# Check if the file has a prefix number followed by a hyphen or space
if [[ $(basename "$file") =~ ^[0-9]+[-\ ] ]]; then
# Remove the prefix and rename the file
new_name=$(echo "$(basename "$file")" | sed -E 's/^[0-9]+[-\ ]//')
mv "$file" "$(dirname "$file")/$new_name"
fi
fi
done
}

# Run the function starting from the current directory
rename_files "$(pwd)"

echo "Renaming completed!"

0 comments on commit e694e75

Please sign in to comment.