runtime/gen_rosti.fish

59 lines
1.4 KiB
Fish
Raw Permalink Normal View History

#!/usr/bin/fish
set TECHS_FILE /tmp/techs.txt
echo -n > $TECHS_FILE
2025-01-19 21:55:11 +00:00
for line in (cat Dockerfile | grep "build_" | grep -v "/usr/local")
set line (echo $line | sed "s/RUN //")
set line (echo $line | sed "s/ADD //")
set line (echo $line | sed "s/& \\\//")
set line (echo $line | sed "s/^[ ]*//")
set VERSION (echo $line | cut -d " " -f 2)
set TECH_SCRIPT (echo $line | cut -d " " -f 1)
switch $TECH_SCRIPT
case "build_php.sh"
set TECH php
set TECH_VERBOSE PHP
2021-03-05 23:39:20 +00:00
case "build_php8.sh"
set TECH php
set TECH_VERBOSE PHP
case "build_python.sh"
set TECH python
set TECH_VERBOSE Python
case "build_node.sh"
set TECH node
set TECH_VERBOSE Node
case "build_ruby.sh"
set TECH ruby
set TECH_VERBOSE Ruby
case "build_deno.sh"
set TECH deno
set TECH_VERBOSE Deno
2024-08-13 17:59:45 +00:00
case "build_bun.sh"
set TECH bun
set TECH_VERBOSE Bun
case "build_golang.sh"
set TECH golang
set TECH_VERBOSE Golang
case "build_openjdk.sh"
set TECH openjdk
set TECH_VERBOSE OpenJDK
case '*'
set TECH unknown
end
echo " \"$TECH-$VERSION\" \" $TECH_VERBOSE $VERSION\" \\" >> $TECHS_FILE
end
cat rosti.tmpl.sh | while read -l line
if [ "$line" = "{{TECHS}}" ]
cat $TECHS_FILE
else
echo $line
end
end