Compare commits
2 Commits
808ce89dfc
...
3396109e00
Author | SHA1 | Date | |
---|---|---|---|
|
3396109e00 | ||
|
fb6afc2ffe |
@ -118,7 +118,7 @@ func (rc *Config) ScanForConfigFile(profile string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors.New("No config file found")
|
return errors.New("no config file found")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rc *Config) LoadConfigFile(file string) error {
|
func (rc *Config) LoadConfigFile(file string) error {
|
||||||
@ -138,10 +138,12 @@ func (rc *Config) LoadConfigFile(file string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Config) Init() error {
|
func (c *Config) Init() error {
|
||||||
for i, w := range c.Template.Websites {
|
fmt.Print("downloading website icons")
|
||||||
|
for i, _ := range c.Template.Websites {
|
||||||
|
fmt.Print(".")
|
||||||
c.Template.Websites[i].Cache()
|
c.Template.Websites[i].Cache()
|
||||||
fmt.Println(w.ImageUrl)
|
|
||||||
}
|
}
|
||||||
|
fmt.Print("\n")
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package rendering
|
|||||||
import (
|
import (
|
||||||
"crypto/sha1"
|
"crypto/sha1"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
@ -49,8 +48,7 @@ func (w *Website) Cache() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
filename := hashUrl(w.ImageUrl)
|
filename := hashUrl(w.ImageUrl) + filepath.Ext(w.ImageUrl)
|
||||||
fmt.Println(w.ImageUrl + " => " + filename)
|
|
||||||
targetPath := filepath.Join(cacheDir, filename)
|
targetPath := filepath.Join(cacheDir, filename)
|
||||||
resp, err := http.Get(w.ImageUrl)
|
resp, err := http.Get(w.ImageUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1 +1 @@
|
|||||||
exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1
|
exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1
|
Loading…
x
Reference in New Issue
Block a user