~adnano/kiln-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] fix: prevent panic when static_dir does not exist

Details
Message ID
<20210825115239.118449-1-git@olivier.pfad.fr>
DKIM signature
missing
Download raw message
Patch: +7 -0
---
This patch prevents a panic when 'static_dir' does not exist.
I choose to simply log it and let the build succeed.
If you prefer, I can change it to abort the build.

Olivier

PS: thank you adnano for your open-source contributions!
 main.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/main.go b/main.go
index 39fb70c..b081099 100644
--- a/main.go
+++ b/main.go
@@ -88,6 +88,10 @@ func (s *Site) runTask(task *Task) error {
	if task.StaticDir != "" {
		err := copyAll(task.StaticDir, task.OutputDir)
		if err != nil {
			if os.IsNotExist(err) {
				log.Printf("static_dir '%s' does not exist\n", task.StaticDir)
				return nil
			}
			return err
		}
	}
@@ -96,6 +100,9 @@ func (s *Site) runTask(task *Task) error {

func copyAll(srcDir, dstDir string) error {
	return filepath.Walk(srcDir, func(path string, info fs.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if info.IsDir() {
			// Do nothing
			return nil
-- 
2.33.0
Details
Message ID
<CDSKWFDVW0EA.2JY8FXKARY46F@nitro>
In-Reply-To
<20210825115239.118449-1-git@olivier.pfad.fr> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git@git.sr.ht:~adnano/kiln
   7201859..bff5e89  master -> master
Reply to thread Export thread (mbox)