add videos to gitignore
This commit is contained in:
parent
8bc4d079d2
commit
11db48df04
2 changed files with 37 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
code/*.tar.gz
|
code/*.tar.gz
|
||||||
log/index.gmi
|
log/index.gmi
|
||||||
|
videos/video-directory
|
||||||
|
|
36
treer.sh
Executable file
36
treer.sh
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Check for directory argument
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Usage: $0 /path/to/directory"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Define the directory you want to scan
|
||||||
|
DIRECTORY="$1"
|
||||||
|
|
||||||
|
# Output file
|
||||||
|
OUTPUT_FILE="$2"
|
||||||
|
|
||||||
|
# Start the .gmi file
|
||||||
|
echo "# Tree of files in $DIRECTORY" > "$OUTPUT_FILE"
|
||||||
|
echo "" >> "$OUTPUT_FILE"
|
||||||
|
|
||||||
|
# Function to recursively list files
|
||||||
|
list_files() {
|
||||||
|
local dir="$1"
|
||||||
|
local prefix="$2"
|
||||||
|
for file in "$dir"/*; do
|
||||||
|
if [ -d "$file" ]; then
|
||||||
|
echo "=> $prefix${file##*/} ${file##*/}" >> "$OUTPUT_FILE"
|
||||||
|
list_files "$file" "$prefix${file##*/}/"
|
||||||
|
elif [ -f "$file" ]; then
|
||||||
|
echo "=> $prefix${file##*/} ${file##*/}" >> "$OUTPUT_FILE"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# Call the function
|
||||||
|
list_files "$DIRECTORY" ""
|
||||||
|
|
||||||
|
echo "Tree structure written to $OUTPUT_FILE"
|
Loading…
Reference in a new issue