first commit
This commit is contained in:
19
.github/workflows/scripts/changelog-utils.sh
vendored
Normal file
19
.github/workflows/scripts/changelog-utils.sh
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Function to extract content from a file
|
||||
# Usage: get_file_content <file_path>
|
||||
# Returns the file content with comments removed, or empty string if file doesn't exist
|
||||
get_file_content() {
|
||||
if [ -f "$1" ]; then
|
||||
content=$(cat "$1")
|
||||
# Skip comments from content
|
||||
content=$(echo "$content" | grep -v '^<!--' | grep -v '^-->')
|
||||
# For version files, also trim newlines and whitespace
|
||||
if [[ "$1" == *"/version" ]]; then
|
||||
content=$(echo "$content" | tr -d '\n' | xargs)
|
||||
fi
|
||||
echo "$content"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user