diff --git a/cmd/radioctl/radioctl.go b/cmd/radioctl/radioctl.go index 233d274b928fdd02aa8815db9fa91fa840c2b179..2325cdb48c89deba18c4b86fa3ee711bb28e5ca0 100644 --- a/cmd/radioctl/radioctl.go +++ b/cmd/radioctl/radioctl.go @@ -109,10 +109,7 @@ func addEncodingFlags(f *gonutsflag.FlagSet, p *autoradio.EncodingParams) { } func mountExists(name string, client *autoradio.Client) bool { - m, err := client.GetMount(name) - if err != nil { - log.Fatal(err) - } + m, _ := client.GetMount(name) return m != nil } @@ -155,7 +152,7 @@ func (cmd *createMountCommand) Run(args []string) { // Check if the mount already exists. client := getClient() - if oldm, _ := client.GetMount(path); oldm != nil { + if mountExists(path, client) { log.Fatal("ERROR: A mount with that name already exists!") } @@ -190,7 +187,7 @@ func newCreateTranscodingMountCommand() *createTranscodingMountCommand { Short: "Create a transcoded mount", Long: ` Create a new stream that will transcode the parent stream with -different encoding parameters. +different encoding parameters. `, }, params: &autoradio.EncodingParams{}, @@ -425,15 +422,16 @@ func (cmd *showMountCommand) Run(args []string) { if len(args) != 1 { log.Fatal("Wrong number of arguments") } - mount, err := getClient().GetMount(args[0]) + + m, err := getClient().GetMount(args[0]) if err != nil { log.Fatalf("ERROR: %v", err) } - if mount == nil { + if m == nil { log.Fatal("ERROR: mount not found") } - printMount(mount) + printMount(m) } var cmdr = &commander.Command{