mirror of
https://github.com/openziti/zrok.git
synced 2024-12-24 23:59:50 +01:00
target handling (#463)
This commit is contained in:
parent
9a90915034
commit
70d5fd7698
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user