← Back to issue list

'No such file or directory' if application is missing the templates dir

View original Github issue

Metadata

Project
craft-application
Number
#546
Type
issue
State
open
Author
tigarmo
Labels
Created
2024-10-24 12:19:09+00:00
Updated
2025-05-23 17:26:54+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### Bug Description I have an admittedly dev version of Rockcraft here that is using the new InitCommand but has no templates. ### To Reproduce Run `toolcraft init` where `toolcraft` has no `templates` dir ### part yaml _No response_ ### Relevant log output ```shell ❯ rockcraft init rockcraft internal error: FileNotFoundError(2, 'No such file or directory') Full execution log: '/home/tiago/.local/state/rockcraft/log/rockcraft-20241024-091607.807534.log' Traceback (most recent call last): File "/snap/rockcraft/x1/lib/python3.10/site-packages/craft_application/application.py", line 600, in run return_code = self._run_inner() File "/snap/rockcraft/x1/lib/python3.10/site-packages/craft_application/application.py", line 550, in _run_inner dispatcher.load_command(self.app_config), File "/snap/rockcraft/x1/lib/python3.10/site-packages/craft_cli/dispatcher.py", line 246, in load_command self._loaded_command.fill_parser(parser) File "/snap/rockcraft/x1/lib/python3.10/site-packages/craft_application/commands/init.py", line 79, in fill_parser choices=self.profiles, File "/snap/rockcraft/x1/lib/python3.10/site-packages/craft_application/commands/init.py", line 98, in profiles template_dirs = [ File "/snap/rockcraft/x1/lib/python3.10/site-packages/craft_application/commands/init.py", line 98, in <listcomp> template_dirs = [ File "/snap/rockcraft/x1/usr/lib/python3.10/pathlib.py", line 1017, in iterdir for name in self._accessor.listdir(self): FileNotFoundError: [Errno 2] No such file or directory: '/snap/rockcraft/x1/lib/python3.10/site-packages/rockcraft/templates' ```

Evaluation history

No evaluation history available.