Skip to content

Fix mount filter to use target paths instead of source prefixes #17

@dguido

Description

@dguido

Problem

extract_mounts_to_file in install.sh filters default mounts by source prefix:

(startswith("source=claude-code-bashhistory-") | not) and
(startswith("source=claude-code-config-") | not) and
...

This is hardcoded to the claude-code volume prefix. If someone forks this and changes the volume names, or if the naming convention changes, the filter silently stops working and default mounts get preserved/duplicated on template reinstall.

Proposed fix

Filter by target path instead, which is constant regardless of volume naming:

(contains("target=/commandhistory,") | not) and
(contains("target=/home/vscode/.claude,") | not) and
(contains("target=/home/vscode/.config/gh,") | not) and
(contains("target=/home/vscode/.gitconfig,") | not) and
(contains("target=/workspace/.devcontainer,") | not)

Also fix the temp file leak — add rm -f "$temp_file" in the else branch when no custom mounts are found.

Already done in trailofbits/skills devcontainer-setup plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions