decentral1se 3 years ago
parent
commit
2a1194e974
No known key found for this signature in database GPG Key ID: 3789458B3D0C410
  1. 1
      .gitignore
  2. 28
      distribusi.go

1
.gitignore

@ -1,3 +1,4 @@
*.css
dist/
distribusi
test

28
distribusi.go

@ -216,12 +216,32 @@ Example:
logrus.Debugf("selecting %s as distribusi root", root)
if err := distribusify(c, root, ignore); err != nil {
logrus.Fatal(err)
}
ch := make(chan error, 2)
go func() {
if err := distribusify(c, root, ignore); err != nil {
ch <- err
return
}
ch <- nil
return
}()
if c.Bool("serve") {
if err := serveHTTP(root); err != nil {
go func() {
if err := serveHTTP(root); err != nil {
ch <- err
return
}
ch <- nil
return
}()
}
for i := 1; i <= 2; i++ {
err := <-ch
if err != nil {
logrus.Fatal(err)
}
}

Loading…
Cancel
Save