diff --git a/gapi/helpers.go b/gapi/helpers.go index ddf4965c..93fd7b8c 100644 --- a/gapi/helpers.go +++ b/gapi/helpers.go @@ -42,8 +42,15 @@ func CopyFileToFs(fs engine.Fs, src, dst string) error { return nil } -// CopyStringToFs copies a file from src path on the local fs to a dst path on -// fs. +// CopyBytesToFs copies a list of bytes to a dst path on fs. +func CopyBytesToFs(fs engine.Fs, b []byte, dst string) error { + if err := fs.WriteFile(dst, b, Umask); err != nil { + return errwrap.Wrapf(err, "can't write to file `%s`", dst) + } + return nil +} + +// CopyStringToFs copies a string to a dst path on fs. func CopyStringToFs(fs engine.Fs, str, dst string) error { if err := fs.WriteFile(dst, []byte(str), Umask); err != nil { return errwrap.Wrapf(err, "can't write to file `%s`", dst)