filebrowser/cmd/version.go
Yonas Yanfa b854347484 fix: build on FreeBSD and non-Linux platforms
`bash` is installed in `/usr/local/bin/bash` on FreeBSD. This patch should make the build work
without modification for FreeBSD and Linux.
2023-02-05 12:23:42 -05:00

22 lines
376 B
Go

package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/filebrowser/filebrowser/v2/version"
)
func init() {
rootCmd.AddCommand(versionCmd)
}
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("File Browser v" + version.Version + "/" + version.CommitSHA)
},
}