Download this file
| 1 | // Command writeestilo re-writes the files internal/calls/static takes from |
| 2 | // the estilo this module pins: theme.css (Calma, with Calls's accent), |
| 3 | // and rastrillo's busy rule as estilo carries it — rastrillo.js without |
| 4 | // the old rule, busy.js and busy.css. Run it from the repository root |
| 5 | // after upgrading estilo; the pin tests in internal/callstest fail until you do. |
| 6 | package main |
| 7 | |
| 8 | import ( |
| 9 | "os" |
| 10 | |
| 11 | "amadan.net/oficina/estilo.git/busy" |
| 12 | "amadan.net/oficina/estilo.git/theme" |
| 13 | ) |
| 14 | |
| 15 | func main() { |
| 16 | css, ok := theme.ForApp("calls") |
| 17 | if !ok { |
| 18 | panic("estilo's theme ring has no calls") |
| 19 | } |
| 20 | for name, body := range map[string][]byte{ |
| 21 | "theme.css": css, |
| 22 | "rastrillo.js": busy.ShimJS(), |
| 23 | "busy.js": busy.JS(), |
| 24 | "busy.css": busy.CSS(), |
| 25 | } { |
| 26 | if err := os.WriteFile("internal/calls/static/"+name, body, 0o644); err != nil { |
| 27 | panic(err) |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | |