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,13 +21,20 @@ 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.IntFlag{
|
&cli.StringFlag{
|
||||||
Name: "window-height",
|
Name: "instance-id",
|
||||||
Value: defaults.Height,
|
EnvVars: []string{"ARCAST_DESKTOP_INSTANCE_ID"},
|
||||||
|
Value: "",
|
||||||
},
|
},
|
||||||
&cli.IntFlag{
|
&cli.IntFlag{
|
||||||
Name: "window-width",
|
Name: "window-height",
|
||||||
Value: defaults.Width,
|
EnvVars: []string{"ARCAST_DESKTOP_WINDOW_HEIGHT"},
|
||||||
|
Value: defaults.Height,
|
||||||
|
},
|
||||||
|
&cli.IntFlag{
|
||||||
|
Name: "window-width",
|
||||||
|
EnvVars: []string{"ARCAST_DESKTOP_WINDOW_WIDTH"},
|
||||||
|
Value: defaults.Width,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Action: func(ctx *cli.Context) error {
|
Action: func(ctx *cli.Context) error {
|
||||||
|
@ -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