Guet errors out when hooks directory isn't present in .git folder
Closed this issue · 1 comments
Bug report
Guet errors out when you run guet start
and there isn't a .git/hooks
directory
Actual behavior?
Produces an error
Expected behavior?
guet creates the hooks directory
Environment:
OSX 10.15.4 / Python 3.7.6
Notes
stacktrace:
File "/usr/local/lib/python3.7/site-packages/guet/util/errors.py", line 9, in wrapper wrapped() File "/usr/local/lib/python3.7/site-packages/guet/main.py", line 57, in main command.execute() File "/usr/local/lib/python3.7/site-packages/guet/commands/strategies/strategy_command.py", line 11, in execute self.strategy.apply() File "/usr/local/lib/python3.7/site-packages/guet/commands/usercommands/start/create_hook_strategy.py", line 6, in apply self.git.create_hooks() File "/usr/local/lib/python3.7/site-packages/guet/git/git.py", line 88, in create_hooks hook.save() File "/usr/local/lib/python3.7/site-packages/guet/git/hook.py", line 62, in save write_lines(self.path, self.content) File "/usr/local/lib/python3.7/site-packages/guet/files/write_lines.py", line 22, in write_lines return _write_lines_to_path(path, lines) File "/usr/local/lib/python3.7/site-packages/guet/files/write_lines.py", line 18, in _write_lines_to_path path.write_text(text) File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/pathlib.py", line 1235, in write_text with self.open(mode='w', encoding=encoding, errors=errors) as f: File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/pathlib.py", line 1203, in open opener=self._opener) File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/pathlib.py", line 1058, in _opener return self._accessor.open(self, flags, mode) FileNotFoundError: [Errno 2] No such file or directory: '/Users/jcrouc15/workspace/conference-call-bingo/.git/hooks/pre-commit'
Deployed as a part of 0b69423.