Tidy tidies up "importmap" script
()
| 26 | |
| 27 | // Tidy tidies up "importmap" script |
| 28 | func Tidy() { |
| 29 | noSRI := flag.Bool("no-sri", false, "do not generate SRI for the import") |
| 30 | _, help := parseCommandFlags() |
| 31 | if help { |
| 32 | fmt.Print(tidyHelpMessage) |
| 33 | return |
| 34 | } |
| 35 | |
| 36 | err := tidy(*noSRI) |
| 37 | if err != nil { |
| 38 | fmt.Println(term.Red("[error]"), "Failed to tidy up: "+err.Error()) |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | func tidy(noSRI bool) (err error) { |
| 43 | indexHtml, exists, err := lookupClosestFile("index.html") |
no test coverage detected