chore(go): wrap core filesystem errors with context
This commit is contained in:
@@ -230,3 +230,13 @@ func (s *RcSuite) TestRc_ScriptsRunWithCwdSetToCastleRoot() {
|
||||
require.NoError(s.T(), s.app.Rc("dotfiles", false))
|
||||
require.Contains(s.T(), s.stdout.String(), castleRoot)
|
||||
}
|
||||
|
||||
func (s *RcSuite) TestRc_ReadHooksErrorIncludesContext() {
|
||||
castleRoot := s.createCastle("dotfiles")
|
||||
homesickD := filepath.Join(castleRoot, ".homesick.d")
|
||||
require.NoError(s.T(), os.WriteFile(homesickD, []byte("x"), 0o644))
|
||||
|
||||
err := s.app.Rc("dotfiles", false)
|
||||
require.Error(s.T(), err)
|
||||
require.Contains(s.T(), err.Error(), "read rc hooks")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user