Compare commits

...

3 Commits

Author SHA1 Message Date
Seednode c02ebc6d9c Remove -c shorthand for --index 2023-09-28 17:01:16 -05:00
Seednode 7aeae50bf5 Update PGO profile 2023-09-28 16:57:50 -05:00
Seednode 2a7d4e71cc Fix indexing running on start when --index is not passed 2023-09-28 16:29:12 -05:00
5 changed files with 9 additions and 7 deletions

View File

@ -118,7 +118,7 @@ Flags:
--handlers display registered handlers (for debugging)
-h, --help help for roulette
--images enable support for image files
-c, --index generate index of supported file paths at startup
--index generate index of supported file paths at startup
--index-file string path to optional persistent index file
-i, --info expose informational endpoints
--max-directory-scans int number of directories to scan at once (default 32)

View File

@ -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,

View File

@ -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")

View File

@ -517,9 +517,11 @@ 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
if Index {
err = importIndex(paths, index, formats)
if err != nil {
return err
}
}
go func() {

Binary file not shown.