Include infrastructure for static files to be included in binary
This commit is contained in:
16
internal/pkg/staticfiles/staticfiles.go
Normal file
16
internal/pkg/staticfiles/staticfiles.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user