#!/bin/bash

# Add empty index.html to every directory under target project

if [ -z "$1" ]; then
    echo "Usage: $0 <project_directory>"
    exit 1
fi

PROJECT="$1"

if [ ! -d "$PROJECT" ]; then
    echo "Directory not found: $PROJECT"
    exit 1
fi


find "$PROJECT" -type d | while read -r dir
do
    if [ ! -f "$dir/index.html" ]; then
        touch "$dir/index.html"
        echo "created: $dir/index.html"
    else
        echo "exists : $dir/index.html"
    fi
done


echo "Done."
