Move DefaultUnixAdminPath to config package
We can drop the soju package import. This shrinks down sojuctl's size significantly (18M to 3M).
This commit is contained in:
parent
4ca8dfa37d
commit
4c8e955946
2
Makefile
2
Makefile
@ -13,7 +13,7 @@ config_path := $(SYSCONFDIR)/soju/config
|
||||
admin_socket_path := $(RUNDIR)/soju/admin
|
||||
goflags := $(GOFLAGS) -ldflags=" \
|
||||
-X 'git.sr.ht/~emersion/soju/config.DefaultPath=$(config_path)' \
|
||||
-X 'git.sr.ht/~emersion/soju.DefaultUnixAdminPath=$(admin_socket_path)'"
|
||||
-X 'git.sr.ht/~emersion/soju/config.DefaultUnixAdminPath=$(admin_socket_path)'"
|
||||
|
||||
all: soju sojudb sojuctl doc/soju.1
|
||||
|
||||
|
@ -214,7 +214,7 @@ func main() {
|
||||
case "unix+admin":
|
||||
path := u.Path
|
||||
if path == "" {
|
||||
path = soju.DefaultUnixAdminPath
|
||||
path = config.DefaultUnixAdminPath
|
||||
}
|
||||
ln, err := net.Listen("unix", path)
|
||||
if err != nil {
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"git.sr.ht/~emersion/soju"
|
||||
"gopkg.in/irc.v4"
|
||||
"log"
|
||||
"net"
|
||||
@ -37,7 +36,7 @@ func run(ctx context.Context, cfg *config.Server, words []string) error {
|
||||
if u.Path != "" {
|
||||
path = u.Path
|
||||
} else {
|
||||
path = soju.DefaultUnixAdminPath
|
||||
path = config.DefaultUnixAdminPath
|
||||
}
|
||||
break
|
||||
}
|
||||
|
@ -11,7 +11,10 @@ import (
|
||||
"git.sr.ht/~emersion/go-scfg"
|
||||
)
|
||||
|
||||
var DefaultPath string
|
||||
var (
|
||||
DefaultPath string
|
||||
DefaultUnixAdminPath = "/run/soju/admin"
|
||||
)
|
||||
|
||||
type IPSet []*net.IPNet
|
||||
|
||||
|
@ -516,3 +516,7 @@ character.
|
||||
Maintained by Simon Ser <contact@emersion.fr>, who is assisted by other
|
||||
open-source contributors. For more information about soju development, see
|
||||
<https://sr.ht/~emersion/soju>.
|
||||
|
||||
# SEE ALSO
|
||||
|
||||
*sojuctl*(1)
|
||||
|
Loading…
Reference in New Issue
Block a user