fix: include custom css once more

This commit is contained in:
decentral1se 2022-02-01 16:18:01 +01:00
parent 7811a18e03
commit 976135fb6c
No known key found for this signature in database
GPG Key ID: 03789458B3D0C410
3 changed files with 4 additions and 2 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
*.css
test test

Binary file not shown.

View File

@ -547,8 +547,6 @@ func mkDiv(c *cli.Context, mtype string, href, fname string, unknown bool) (stri
// writeIndex writes a new index.html. // writeIndex writes a new index.html.
func writeIndex(fpath string, html []string, styles string) error { func writeIndex(fpath string, html []string, styles string) error {
body := fmt.Sprintf(htmlBody, generatedInDistribusi, "", strings.Join(html, "\n")) body := fmt.Sprintf(htmlBody, generatedInDistribusi, "", strings.Join(html, "\n"))
HTMLPath := path.Join(fpath, "index.html")
contents := []byte(body)
if styles != "" { if styles != "" {
absPath, err := filepath.Abs(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 _, err := os.Stat(HTMLPath); err != nil {
if os.IsNotExist(err) { if os.IsNotExist(err) {
if err := ioutil.WriteFile(HTMLPath, contents, 0644); err != nil { if err := ioutil.WriteFile(HTMLPath, contents, 0644); err != nil {