Skip to content

Commit

Permalink
Add minifier tool (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg committed Jan 2, 2024
1 parent 59c953c commit 158d7e0
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package main

import (
"os"

"github.com/go-toolsmith/minformat"
)

func main() {
if len(os.Args) != 2 {
panic("needs 1 argument: file to process")
}

filename := os.Args[1]

b, err := os.ReadFile(filename)
if err != nil {
panic(err)
}

res, err := minformat.Source(b)
if err != nil {
panic(err)
}

if _, err := os.Stdout.Write(res); err != nil {
panic(err)
}
}

0 comments on commit 158d7e0

Please sign in to comment.