netbootLLM / scripts /build.sh
Rafael Calleja
create generator
e4a5291
raw
history blame
827 Bytes
#!/bin/bash
# Function to create the structure
generate_structure() {
local dir_path=$1
local base_name=$(basename "$(dirname "$(dirname "$dir_path")")")
local version=$(basename "$(dirname "$dir_path")")
local flavor=$(basename "$dir_path")
# Defining the structure
echo " ${base_name}-${version}-${flavor}-custom:"
echo " path: /${dir_path#./}"
echo " files:"
# Listing files in the directory
for file in "$dir_path"/*; do
echo " - $(basename "$file")"
done
echo " os: ${base_name}-custom"
echo " version: '$version'"
echo " flavor: $flavor"
echo " kernel: ${base_name}-${version}-${flavor}-custom"
echo ""
}
# Iterating over the directories inside 'data'
find ./data -mindepth 4 -maxdepth 4 -type d | while read -r dir; do
generate_structure "$dir"
done