Files
2025-11-28 10:16:47 +01:00

27 lines
686 B
Bash
Executable File

#!/bin/bash
# Function to do post-processing of the generated skel
post_process_skel() {
local file="$1"
# Using sed to remove lines matching the patterns
sed -i '/^from /d' "$file"
sed -i '/^import /d' "$file"
sed -i '/^if TYPE_CHECKING/d' "$file"
sed -i '/^[[:space:]]*pass\b/d' "$file"
}
# Function to prepend skel_intro.txt and then run the skel command
generate_summary() {
echo $1
local output_file="$1"
shift
local temp_file=$(mktemp)
~/bin/skel "$@" -o "$temp_file"
cat skel_intro.txt "$temp_file" > "$output_file"
rm "$temp_file"
post_process_skel "$output_file"
}
# Example usage:
generate_summary "summary.py.txt" &