Run from anywhere
Get the runpath at runtime, in order to run MovieNight from whatever position into the filesystem.
This commit is contained in:
parent
b3dc13affb
commit
516b9a212b
10
main.go
10
main.go
|
@ -6,7 +6,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
// "path/filepath"
|
||||||
|
|
||||||
"github.com/gorilla/sessions"
|
"github.com/gorilla/sessions"
|
||||||
"github.com/nareix/joy4/format"
|
"github.com/nareix/joy4/format"
|
||||||
|
@ -22,7 +22,6 @@ var (
|
||||||
stats = newStreamStats()
|
stats = newStreamStats()
|
||||||
sAdminPass string
|
sAdminPass string
|
||||||
confFile string
|
confFile string
|
||||||
runPath string
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func setupSettings() error {
|
func setupSettings() error {
|
||||||
|
@ -51,13 +50,6 @@ func setupSettings() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ex, er := os.Executable()
|
|
||||||
if er != nil {
|
|
||||||
panic(er)
|
|
||||||
}
|
|
||||||
runPath := filepath.Dir(ex)
|
|
||||||
fmt.Println(runPath)
|
|
||||||
|
|
||||||
flag.StringVar(&addr, "l", "", "host:port of the HTTP server")
|
flag.StringVar(&addr, "l", "", "host:port of the HTTP server")
|
||||||
flag.StringVar(&rtmpAddr, "r", "", "host:port of the RTMP server")
|
flag.StringVar(&rtmpAddr, "r", "", "host:port of the RTMP server")
|
||||||
flag.StringVar(&sKey, "k", "", "Stream key, to protect your stream")
|
flag.StringVar(&sKey, "k", "", "Stream key, to protect your stream")
|
||||||
|
|
Loading…
Reference in New Issue