target handling (#463)

This commit is contained in:
Michael Quigley 2024-09-13 14:48:01 -04:00
parent 9a90915034
commit 70d5fd7698
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -73,14 +73,37 @@ func (cmd *agentSharePublicCommand) run(_ *cobra.Command, args []string) {
target = v target = v
case "web": case "web":
var err error v, err := filepath.Abs(args[0])
target, err = filepath.Abs(args[0])
if err != nil { if err != nil {
if !panicInstead {
tui.Error("invalid target endpoint URL", err)
}
panic(err) panic(err)
} }
target = v
case "caddy":
v, err := filepath.Abs(args[0])
if err != nil {
if !panicInstead {
tui.Error("invalid target endpoint URL", err)
}
panic(err)
}
target = v
case "drive":
v, err := filepath.Abs(args[0])
if err != nil {
if !panicInstead {
tui.Error("invalid target endpoint URL", err)
}
panic(err)
}
target = v
default: default:
target = args[0] tui.Error(fmt.Sprintf("invalid backend mode '%v'", cmd.backendMode), nil)
} }
root, err := environment.LoadRoot() root, err := environment.LoadRoot()