Skip to content

Commit

Permalink
Allow changing package name (rakyll#45)
Browse files Browse the repository at this point in the history
Allows changing the name of the generated package.
  • Loading branch information
grubernaut authored and rakyll committed Jul 9, 2018
1 parent eab4de8 commit d5ad23b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion statik.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,19 @@ import (
)

const (
namePackage = "statik"
nameSourceFile = "statik.go"
)

var namePackage string

var (
flagSrc = flag.String("src", path.Join(".", "public"), "The path of the source directory.")
flagDest = flag.String("dest", ".", "The destination path of the generated package.")
flagNoMtime = flag.Bool("m", false, "Ignore modification times on files.")
flagNoCompress = flag.Bool("Z", false, "Do not use compression to shrink the files.")
flagForce = flag.Bool("f", false, "Overwrite destination file if it already exists.")
flagTags = flag.String("tags", "", "Write build constraint tags")
flagPkg = flag.String("p", "statik", "Name of the generated package")
)

// mtimeDate holds the arbitrary mtime that we assign to files when
Expand All @@ -51,6 +53,8 @@ var mtimeDate = time.Date(2000, time.January, 1, 0, 0, 0, 0, time.UTC)
func main() {
flag.Parse()

namePackage = *flagPkg

file, err := generateSource(*flagSrc)
if err != nil {
exitWithError(err)
Expand Down

0 comments on commit d5ad23b

Please sign in to comment.