Something went wrong. Try again.
Programatically Generated Steam Grids
Something went wrong. Try again.
asciimplicity build
1.2 kB · 27 lines
at main
12345678910111213141516171819202122232425262728#!/usr/bin/env nu
def main [ toBuild: string = "@all" flavor: string = "mocha"] { mkdir out if $toBuild == "@all" { print "Manifest name is set to @all, compiling all manifests" let manifests = ls -l manifests/*.yaml | where type == file | get name | each {|x| $x | parse 'manifests/{name}.yaml' | get name | $in.0 } for manifest in $manifests { print $"Compiling ($manifest)..." typst c main.typ $"out/($manifest){p}.png" --input flavor=$"($flavor)" --input manifest=$"($manifest)" --ppi 72 mv $"out/($manifest)1.png" $"out/($manifest)-vertical.png" mv $"out/($manifest)2.png" $"out/($manifest)-horizontal.png" } } else { mut manifest = $toBuild while (ls -l $"manifests/($manifest).yaml" | $in.target.0 != null) { $manifest = ls -l $"manifests/($manifest).yaml" | $in.target.0 | parse '{name}.yaml' | get name | $in.0 } print $"Compiling ($manifest)..." typst c main.typ $"out/($manifest){p}.png" --input flavor=$"($flavor)" --input manifest=$"($manifest)" --ppi 72 mv $"out/($manifest)1.png" $"out/($manifest)-vertical.png" mv $"out/($manifest)2.png" $"out/($manifest)-horizontal.png" }}