GetFileContents reads the contents of a file at the specified path
(afs afero.Fs, path string)
| 376 | |
| 377 | // GetFileContents reads the contents of a file at the specified path |
| 378 | func GetFileContents(afs afero.Fs, path string) ([]byte, error) { |
| 379 | // validate file |
| 380 | err := ValidateFile(afs, path) |
| 381 | if err != nil { |
| 382 | return nil, err |
| 383 | } |
| 384 | |
| 385 | // get file contents |
| 386 | file, err := readFile(afs, path) |
| 387 | if err != nil { |
| 388 | return nil, err |
| 389 | } |
| 390 | |
| 391 | return file, nil |
| 392 | } |
| 393 | |
| 394 | // CheckForNewerVersion checks if a newer version of the project is available on the GitHub repository |
| 395 | func CheckForNewerVersion(client *github.Client, currentVersion string) (bool, string, error) { |