decentral1se
3 years ago
No known key found for this signature in database
GPG Key ID: 3789458B3D0C410
2 changed files with
25 additions and
4 deletions
-
.gitignore
-
distribusi.go
|
@ -1,3 +1,4 @@ |
|
|
*.css |
|
|
*.css |
|
|
dist/ |
|
|
dist/ |
|
|
|
|
|
distribusi |
|
|
test |
|
|
test |
|
|
|
@ -216,12 +216,32 @@ Example: |
|
|
|
|
|
|
|
|
logrus.Debugf("selecting %s as distribusi root", root) |
|
|
logrus.Debugf("selecting %s as distribusi root", root) |
|
|
|
|
|
|
|
|
|
|
|
ch := make(chan error, 2) |
|
|
|
|
|
go func() { |
|
|
if err := distribusify(c, root, ignore); err != nil { |
|
|
if err := distribusify(c, root, ignore); err != nil { |
|
|
logrus.Fatal(err) |
|
|
ch <- err |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ch <- nil |
|
|
|
|
|
return |
|
|
|
|
|
}() |
|
|
|
|
|
|
|
|
if c.Bool("serve") { |
|
|
if c.Bool("serve") { |
|
|
|
|
|
go func() { |
|
|
if err := serveHTTP(root); err != nil { |
|
|
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) |
|
|
logrus.Fatal(err) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|