chore(go): wrap core filesystem errors with context

This commit is contained in:
Micheal Wilkinson
2026-03-21 20:52:13 +00:00
parent bc0a6747b8
commit c793925828
6 changed files with 135 additions and 56 deletions

View File

@@ -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")
}