mirror of
https://github.com/openziti/zrok.git
synced 2024-12-23 23:29:22 +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
|
||||
|
||||
case "web":
|
||||
var err error
|
||||
target, err = filepath.Abs(args[0])
|
||||
v, err := filepath.Abs(args[0])
|
||||
if err != nil {
|
||||
if !panicInstead {
|
||||
tui.Error("invalid target endpoint URL", 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:
|
||||
target = args[0]
|
||||
tui.Error(fmt.Sprintf("invalid backend mode '%v'", cmd.backendMode), nil)
|
||||
}
|
||||
|
||||
root, err := environment.LoadRoot()
|
||||
|
Loading…
Reference in New Issue
Block a user