Skip to content

Commit

Permalink
Saving progress
Browse files Browse the repository at this point in the history
Signed-off-by: John Mertic <[email protected]>
  • Loading branch information
jmertic committed Nov 29, 2023
1 parent 5c13abb commit d7f787f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
26 changes: 21 additions & 5 deletions buildimages.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
#!/bin/bash
#

while getopts c:l: flag
updateall="n"

while getopts c:l:a flag
do
case "${flag}" in
c) crunchbase=${OPTARG};;
l) baselogo=${OPTARG};;
a) updateall="y"
esac
done

IFS=$'\n'
items=( $(yq '.landscape[] | select(.name != "LF Energy Member") | .subcategories[].items[] | select(.crunchbase == "*/'${crunchbase}'*") .name' landscape.yml) )

#items=("makani" "transitfeed" "Carbon free energy for Google Cloud regions" "Analysis-Ready, Cloud Optimized ERA5" "weather-tools")
#baselogo="https://landscape.lfenergy.org/logos/google-llc.svg"
for item in "${!items[@]}"
do
echo -n "Getting logo for ${items[$item]}..."
eval echo $(curl --no-progress-meter -X POST -H "Content-Type: application/json" -d "{\"url\": \"${baselogo}\", \"caption\": \"${items[$item]}\", \"title\": \"\", \"captionWidth\": \"80\"}" https://autocrop.cncf.io/autocrop | jq ".result") > "hosted_logos/${items[$item]}.svg"
echo "DONE"
if [ "$updateall" = "n" ] && [ -f "hosted_logos/${items[$item]}.svg" ]
then
echo "SKIP - FILE EXISTS - hosted_logos/${items[$item]}.svg"
elif ! [ -z "$baselogo" ]
then
eval echo $(curl --no-progress-meter -X POST -H "Content-Type: application/json" -d "{\"url\": \"${baselogo}\", \"caption\": \"${items[$item]}\", \"title\": \"\", \"captionWidth\": \"80\"}" https://autocrop.cncf.io/autocrop | jq ".result") > "hosted_logos/${items[$item]}.svg"
echo "DONE"
else
echo "<svg><text>${items[$item]}</text></svg>" > text.svg
if ! command -v inkscape &> /dev/null
then
echo "SKIP - INKSCAPE NOT FOUND"
else
inkscape text.svg --export-text-to-path --export-plain-svg --export-filename=${items[$item]} --export-area-drawing
echo "DONE - TEXT LOGO"
fi
fi
done
11 changes: 8 additions & 3 deletions maketextimages.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#!/bin/bash
#

while getopts c:l: flag
newonly="n"

while getopts c:l:n flag
do
case "${flag}" in
c) crunchbase=${OPTARG};;
l) baselogo=${OPTARG};;
n) newonly="y"
esac
done

IFS=$'\n'
items=( $(ls -ag hosted_logos | grep "9406 Apr 11 16:48") )
items=( $(yq '.landscape[] | select(.name != "LF Energy Member") | .subcategories[].items[] | select(.crunchbase == "*/'${crunchbase}'*") .name' landscape.yml) )
IFS=$'\n'

for item in "${!items[@]}"
do
Expand All @@ -23,5 +26,7 @@ do
echo -n "Making logo for $logoname..."
echo "<svg><text>$logoname</text></svg>" > text.svg
inkscape text.svg --export-text-to-path --export-plain-svg --export-filename=$logofile --export-area-drawing
echo "<svg><text>$logoname</text></svg>" > text.svg
inkscape text.svg --export-text-to-path --export-plain-svg --export-filename=$logofile --export-area-drawing
echo "DONE"
done

0 comments on commit d7f787f

Please sign in to comment.