Fix file permissions issues
This commit is contained in:
parent
2c0a3c7d80
commit
532b9f2bbb
2 changed files with 2 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
||||||
main
|
main
|
||||||
saved_notes
|
saved_notes
|
||||||
|
static
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ type Asset struct {
|
||||||
func (asset *Asset) FetchIfNotExists(staticPath string) {
|
func (asset *Asset) FetchIfNotExists(staticPath string) {
|
||||||
destPath := filepath.Join(staticPath, asset.Path)
|
destPath := filepath.Join(staticPath, asset.Path)
|
||||||
|
|
||||||
err := os.MkdirAll(path.Dir(destPath), os.ModeDir|0777)
|
err := os.MkdirAll(path.Dir(destPath), os.FileMode(0750))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Couldn't create parent dirs of %s\n", destPath)
|
log.Printf("Couldn't create parent dirs of %s\n", destPath)
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
@ -82,8 +82,6 @@ func LoadConfig(path string) {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
os.Mkdir(Conf.Static.Dir, os.FileMode(750))
|
|
||||||
|
|
||||||
for _, asset := range Conf.Static.Assets {
|
for _, asset := range Conf.Static.Assets {
|
||||||
asset.FetchIfNotExists(Conf.Static.Dir)
|
asset.FetchIfNotExists(Conf.Static.Dir)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue