Include infrastructure for static files to be included in binary

This commit is contained in:
Gregory Kurtzer
2020-12-04 22:11:14 -08:00
parent 4e93745bc6
commit 30a86ea8ac
6 changed files with 130 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package staticfiles
import (
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"io/ioutil"
)
func WriteData(source string, dest string) error {
bytes, err := getResource(source)
err = ioutil.WriteFile(dest, bytes, 0644)
if err != nil {
wwlog.Printf(wwlog.ERROR, "Failed writing %s to: %s\n", dest, err)
return err
}
return nil
}