Browse Source

fix: include custom css once more

main
decentral1se 3 years ago
parent
commit
976135fb6c
No known key found for this signature in database GPG Key ID: 3789458B3D0C410
  1. 1
      .gitignore
  2. BIN
      distribusi
  3. 5
      distribusi.go

1
.gitignore

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

BIN
distribusi

Binary file not shown.

5
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 {

Loading…
Cancel
Save