feat(desktop): pass instance id as flag or environment variable
This commit is contained in:
parent
c53a566fe7
commit
9884855e3c
|
@ -1 +1,2 @@
|
||||||
ARCAST_DESKTOP_ADDITIONAL_CHROME_ARGS=
|
ARCAST_DESKTOP_ADDITIONAL_CHROME_ARGS=
|
||||||
|
ARCAST_DESKTOP_INSTANCE_ID=
|
|
@ -9,6 +9,6 @@ func main() {
|
||||||
command.Main(
|
command.Main(
|
||||||
"arcast",
|
"arcast",
|
||||||
"Arcast desktop player",
|
"Arcast desktop player",
|
||||||
player.Root(),
|
player.Root().Subcommands...,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,12 +21,19 @@ func Run() *cli.Command {
|
||||||
EnvVars: []string{"ARCAST_DESKTOP_ADDITIONAL_CHROME_ARGS"},
|
EnvVars: []string{"ARCAST_DESKTOP_ADDITIONAL_CHROME_ARGS"},
|
||||||
Value: cli.NewStringSlice("incognito"),
|
Value: cli.NewStringSlice("incognito"),
|
||||||
},
|
},
|
||||||
|
&cli.StringFlag{
|
||||||
|
Name: "instance-id",
|
||||||
|
EnvVars: []string{"ARCAST_DESKTOP_INSTANCE_ID"},
|
||||||
|
Value: "",
|
||||||
|
},
|
||||||
&cli.IntFlag{
|
&cli.IntFlag{
|
||||||
Name: "window-height",
|
Name: "window-height",
|
||||||
|
EnvVars: []string{"ARCAST_DESKTOP_WINDOW_HEIGHT"},
|
||||||
Value: defaults.Height,
|
Value: defaults.Height,
|
||||||
},
|
},
|
||||||
&cli.IntFlag{
|
&cli.IntFlag{
|
||||||
Name: "window-width",
|
Name: "window-width",
|
||||||
|
EnvVars: []string{"ARCAST_DESKTOP_WINDOW_WIDTH"},
|
||||||
Value: defaults.Width,
|
Value: defaults.Width,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -57,7 +64,12 @@ func Run() *cli.Command {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
server := server.New(browser)
|
instanceID := ctx.String("instance-id")
|
||||||
|
if instanceID == "" {
|
||||||
|
instanceID = server.NewRandomInstanceID()
|
||||||
|
}
|
||||||
|
|
||||||
|
server := server.New(browser, server.WithInstanceID(instanceID))
|
||||||
|
|
||||||
if err := server.Start(); err != nil {
|
if err := server.Start(); err != nil {
|
||||||
return errors.Wrap(err, "could not start server")
|
return errors.Wrap(err, "could not start server")
|
||||||
|
|
|
@ -4,5 +4,5 @@ modd.conf
|
||||||
.env {
|
.env {
|
||||||
prep: make build-client
|
prep: make build-client
|
||||||
prep: make build-desktop
|
prep: make build-desktop
|
||||||
daemon: make run RUN_CMD="bin/desktop --debug --log-level debug player run"
|
daemon: make run RUN_CMD="bin/desktop --debug --log-level debug run"
|
||||||
}
|
}
|
Loading…
Reference in New Issue