Compare commits
2 Commits
c02ebc6d9c
...
fa1e3d126f
Author | SHA1 | Date |
---|---|---|
Seednode | fa1e3d126f | |
Seednode | 71497198fa |
|
@ -398,7 +398,7 @@ Poll:
|
|||
}
|
||||
|
||||
if Verbose {
|
||||
fmt.Printf("%s | INDEX: Selected %d/%d files across %d/%d directories in %s\n",
|
||||
fmt.Printf("%s | INDEX: Selecting from %d/%d files across %d/%d directories in %s\n",
|
||||
time.Now().Format(logDate),
|
||||
stats.filesMatched,
|
||||
stats.filesMatched+stats.filesSkipped,
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
ReleaseVersion string = "2.0.1"
|
||||
ReleaseVersion string = "2.0.3"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -95,7 +95,7 @@ func init() {
|
|||
rootCmd.Flags().BoolVar(&Flash, "flash", false, "enable support for shockwave flash files (via ruffle.rs)")
|
||||
rootCmd.Flags().BoolVar(&Handlers, "handlers", false, "display registered handlers (for debugging)")
|
||||
rootCmd.Flags().BoolVar(&Images, "images", false, "enable support for image files")
|
||||
rootCmd.Flags().BoolVarP(&Index, "index", "c", false, "generate index of supported file paths at startup")
|
||||
rootCmd.Flags().BoolVar(&Index, "index", false, "generate index of supported file paths at startup")
|
||||
rootCmd.Flags().StringVar(&IndexFile, "index-file", "", "path to optional persistent index file")
|
||||
rootCmd.Flags().BoolVarP(&Info, "info", "i", false, "expose informational endpoints")
|
||||
rootCmd.Flags().IntVar(&MaxDirScans, "max-directory-scans", 32, "number of directories to scan at once")
|
||||
|
|
22
cmd/web.go
22
cmd/web.go
|
@ -416,29 +416,29 @@ func ServePage(args []string) error {
|
|||
}
|
||||
|
||||
if Audio || All {
|
||||
formats.Add(audio.New())
|
||||
formats.Add(audio.Format{})
|
||||
}
|
||||
|
||||
if Code || All {
|
||||
formats.Add(code.New(CodeTheme))
|
||||
formats.Add(code.Format{Theme: CodeTheme})
|
||||
}
|
||||
|
||||
if Flash || All {
|
||||
formats.Add(flash.New())
|
||||
formats.Add(flash.Format{})
|
||||
}
|
||||
|
||||
if Text || All {
|
||||
formats.Add(text.New())
|
||||
formats.Add(text.Format{})
|
||||
}
|
||||
|
||||
if Videos || All {
|
||||
formats.Add(video.New())
|
||||
formats.Add(video.Format{})
|
||||
}
|
||||
|
||||
// enable image support if no other flags are passed, to retain backwards compatibility
|
||||
// to be replaced with rootCmd.MarkFlagsOneRequired on next spf13/cobra update
|
||||
if Images || All || len(formats.Extensions) == 0 {
|
||||
formats.Add(images.New())
|
||||
formats.Add(images.Format{})
|
||||
}
|
||||
|
||||
paths, err := validatePaths(args, formats)
|
||||
|
@ -503,6 +503,11 @@ func ServePage(args []string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = importIndex(paths, index, formats)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if Info {
|
||||
|
@ -517,11 +522,6 @@ func ServePage(args []string) error {
|
|||
fmt.Printf("WARNING! Files *will* be deleted after serving!\n\n")
|
||||
}
|
||||
|
||||
err = importIndex(paths, index, formats)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
go func() {
|
||||
for err := range errorChannel {
|
||||
fmt.Printf("%s | ERROR: %v\n", time.Now().Format(logDate), err)
|
||||
|
|
BIN
default.pgo
BIN
default.pgo
Binary file not shown.
|
@ -61,10 +61,6 @@ func (t Format) Type() string {
|
|||
return "embed"
|
||||
}
|
||||
|
||||
func New() Format {
|
||||
return Format{}
|
||||
}
|
||||
|
||||
func init() {
|
||||
types.SupportedFormats.Register(New())
|
||||
types.SupportedFormats.Register(Format{})
|
||||
}
|
||||
|
|
|
@ -225,12 +225,6 @@ func (t Format) Type() string {
|
|||
return "inline"
|
||||
}
|
||||
|
||||
func New(theme string) Format {
|
||||
return Format{
|
||||
Theme: theme,
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
types.SupportedFormats.Register(New(""))
|
||||
types.SupportedFormats.Register(Format{})
|
||||
}
|
||||
|
|
|
@ -60,10 +60,6 @@ func (t Format) Type() string {
|
|||
return "embed"
|
||||
}
|
||||
|
||||
func New() Format {
|
||||
return Format{}
|
||||
}
|
||||
|
||||
func init() {
|
||||
types.SupportedFormats.Register(New())
|
||||
types.SupportedFormats.Register(Format{})
|
||||
}
|
||||
|
|
|
@ -124,10 +124,6 @@ func (t Format) Type() string {
|
|||
return "embed"
|
||||
}
|
||||
|
||||
func New() Format {
|
||||
return Format{}
|
||||
}
|
||||
|
||||
func init() {
|
||||
types.SupportedFormats.Register(New())
|
||||
types.SupportedFormats.Register(Format{})
|
||||
}
|
||||
|
|
|
@ -80,10 +80,6 @@ func (t Format) Type() string {
|
|||
return "inline"
|
||||
}
|
||||
|
||||
func New() Format {
|
||||
return Format{}
|
||||
}
|
||||
|
||||
func init() {
|
||||
types.SupportedFormats.Register(New())
|
||||
types.SupportedFormats.Register(Format{})
|
||||
}
|
||||
|
|
|
@ -67,10 +67,6 @@ func (t Format) Type() string {
|
|||
return "embed"
|
||||
}
|
||||
|
||||
func New() Format {
|
||||
return Format{}
|
||||
}
|
||||
|
||||
func init() {
|
||||
types.SupportedFormats.Register(New())
|
||||
types.SupportedFormats.Register(Format{})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue