FileWrite takes a path and a string to write to that file, and builds a Step that does that to them.
(p, s string)
| 222 | // FileWrite takes a path and a string to write to that file, and builds a Step |
| 223 | // that does that to them. |
| 224 | func FileWrite(p, s string) Step { // path & string |
| 225 | return &manualStep{ |
| 226 | action: func() error { |
| 227 | // TODO: apparently using 0666 is equivalent to respecting the current umask |
| 228 | const umask = 0666 |
| 229 | return os.WriteFile(p, []byte(s), umask) |
| 230 | }, |
| 231 | expect: func() error { return nil }, |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | // ErrIsNotExistOK returns nil if we get an IsNotExist true result on the error. |
| 236 | func ErrIsNotExistOK(e error) error { |
no test coverage detected