Skip to content

Commit c76ae19

Browse files
committed
Don't try to infer the dependencies directory in component compile
We mount the component repo at `/<component-name>` in the Docker container when using `component compile` in the component template. In that case, the old code inferred `dependencies_dir` as `/` which isn't writable in the container environment. This commit adjusts the implementation to use `config.inventory.dependencies_dir` which should always be writable. Since we don't actually use any functionality backed by `MultiDependency` in `component compile` it shouldn't matter whether we actually find the correct dependencies directory in all cases.
1 parent 4a87ae8 commit c76ae19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

commodore/component/compile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _setup_component(
143143
target_dir = P(cr.working_tree_dir)
144144
# compute subpath from Repo working tree dir and component path
145145
sub_path = str(component_path.absolute().relative_to(target_dir))
146-
cdep = MultiDependency(cr.remote().url, target_dir.parent)
146+
cdep = MultiDependency(cr.remote().url, config.inventory.dependencies_dir)
147147
except git.InvalidGitRepositoryError:
148148
click.echo(" > Couldn't determine Git repository for component")
149149
# Just treat `component_path` as a directory holding a component, don't care

0 commit comments

Comments
 (0)