fixed static files init
This commit is contained in:
parent
3f48211ffb
commit
5739a9348c
|
@ -42,7 +42,7 @@ func CreateRepository(name string) (Repository, error) {
|
||||||
if file.IsDir() {
|
if file.IsDir() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
src_data, _ := static_files.ReadFile(file.Name())
|
src_data, _ := static_files.ReadFile("embed/initial/static/" + file.Name())
|
||||||
os.WriteFile(newRepo.StaticDir()+"/"+file.Name(), src_data, 0644)
|
os.WriteFile(newRepo.StaticDir()+"/"+file.Name(), src_data, 0644)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -167,6 +167,20 @@ func TestNewRepoGetsStaticFiles(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestNewRepoGetsStaticFilesPicoCSSWithContent(t *testing.T) {
|
||||||
|
// Create a new user
|
||||||
|
repo, _ := owl.CreateRepository(testRepoName())
|
||||||
|
file, err := os.Open(path.Join(repo.StaticDir(), "pico.min.css"))
|
||||||
|
if err != nil {
|
||||||
|
t.Error("Error opening pico.min.css")
|
||||||
|
}
|
||||||
|
// check that the file has content
|
||||||
|
stat, _ := file.Stat()
|
||||||
|
if stat.Size() == 0 {
|
||||||
|
t.Error("pico.min.css is empty")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestNewRepoGetsBaseHtml(t *testing.T) {
|
func TestNewRepoGetsBaseHtml(t *testing.T) {
|
||||||
// Create a new user
|
// Create a new user
|
||||||
repo, _ := owl.CreateRepository(testRepoName())
|
repo, _ := owl.CreateRepository(testRepoName())
|
||||||
|
|
Loading…
Reference in New Issue