MCPcopy
hub / github.com/esm-dev/esm.sh / Tidy

Function Tidy

cli/command_tidy.go:28–40  ·  view source on GitHub ↗

Tidy tidies up "importmap" script

()

Source from the content-addressed store, hash-verified

26
27// Tidy tidies up "importmap" script
28func 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
42func tidy(noSRI bool) (err error) {
43 indexHtml, exists, err := lookupClosestFile("index.html")

Callers 1

RunFunction · 0.85

Calls 3

parseCommandFlagsFunction · 0.85
tidyFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected