Fix Windows tests, verify in CI (#394)
* ci: Test on Windows too Adds a Windows test run to CI. Go setup relies on GHA for this because Hermit doesn't yet support Windows. * fix(mapper_windows_test): assert.NotNil => assert.True assert.NotNil does not exist. * filecontent mapper: Handle error from directory If we couldn't read because the source is a directory, override the original error message. * fix(test): Handle platform-specific "file not found" messages
This commit is contained in:
@@ -717,6 +717,9 @@ func fileContentMapper(r *Registry) MapperFunc {
|
||||
data, err = ioutil.ReadAll(os.Stdin)
|
||||
}
|
||||
if err != nil {
|
||||
if info, statErr := os.Stat(path); statErr == nil && info.IsDir() {
|
||||
return fmt.Errorf("%q exists but is a directory: %w", path, err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
target.SetBytes(data)
|
||||
|
||||
Reference in New Issue
Block a user