mirror of
https://github.com/qdrant/landing_page.git
synced 2026-09-25 22:18:30 +02:00
fix image generation script
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
# directory of the current script
|
||||
|
||||
set -e
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
|
||||
@@ -14,6 +16,14 @@ function get_value_from_md() {
|
||||
local key=$1
|
||||
local file=$2
|
||||
local value=$(grep -m 1 "^$key:" "$file" | sed "s/^$key: //")
|
||||
|
||||
# remove comments from the value, starting with #
|
||||
|
||||
value=$(echo "$value" | sed 's/#.*//')
|
||||
|
||||
# remove leading and trailing spaces
|
||||
value=$(echo "$value" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||
|
||||
echo "$value"
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,15 @@ function check_file_exists_and_new() {
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
abs_path_file=$(realpath "${file}")
|
||||
abs_path_to_image=$(realpath "${PATH_TO_IMAGE}")
|
||||
|
||||
|
||||
if [ "${abs_path_file}" == "${abs_path_to_image}" ]; then
|
||||
echo "Source image and destination image are the same. Please provide a different destination"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_file_exists_and_new "${IMG_DESTINATION}/social_preview.jpg"
|
||||
|
||||
Reference in New Issue
Block a user