decentral1se
3 years ago
No known key found for this signature in database
GPG Key ID: 3789458B3D0C410
3 changed files with
4 additions and
2 deletions
-
.gitignore
-
BIN
distribusi
-
distribusi.go
|
|
@ -547,8 +547,6 @@ func mkDiv(c *cli.Context, mtype string, href, fname string, unknown bool) (stri |
|
|
|
// writeIndex writes a new index.html.
|
|
|
|
func writeIndex(fpath string, html []string, styles string) error { |
|
|
|
body := fmt.Sprintf(htmlBody, generatedInDistribusi, "", strings.Join(html, "\n")) |
|
|
|
HTMLPath := path.Join(fpath, "index.html") |
|
|
|
contents := []byte(body) |
|
|
|
|
|
|
|
if styles != "" { |
|
|
|
absPath, err := filepath.Abs(styles) |
|
|
@ -566,6 +564,9 @@ func writeIndex(fpath string, html []string, styles string) error { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
HTMLPath := path.Join(fpath, "index.html") |
|
|
|
contents := []byte(body) |
|
|
|
|
|
|
|
if _, err := os.Stat(HTMLPath); err != nil { |
|
|
|
if os.IsNotExist(err) { |
|
|
|
if err := ioutil.WriteFile(HTMLPath, contents, 0644); err != nil { |
|
|
|