Skip to content

fix: filter integration scripts by script_type#19

Draft
kailanjian wants to merge 1 commit into
af-mainfrom
fix/install-scripts-filter-by-script-type
Draft

fix: filter integration scripts by script_type#19
kailanjian wants to merge 1 commit into
af-mainfrom
fix/install-scripts-filter-by-script-type

Conversation

@kailanjian
Copy link
Copy Markdown

Description

install_scripts() accepted a script_type parameter to filter which script variant to copy (.sh or .ps1), but every caller in MarkdownIntegration, TomlIntegration, SkillsIntegration, and ForgeIntegration invoked it without passing the type. The result: --script sh had no effect on the physical file copy — both update-context.sh and update-context.ps1 were always installed regardless of the flag.

The .ps1 file landed on disk but was never referenced (the generated skills and integration.json correctly used the sh variant), making it inert dead weight on Mac/Linux.

The --script flag already correctly switched three other things:

  • Which shared scripts directory is copied (bash/ vs powershell/)
  • Which script path gets embedded in generated skill/command markdown
  • Which filename integration.json records

This PR closes the gap for the fourth: which files are physically copied by install_scripts().

Changes:

  • integrations/base.py — add script_type: str | None = None param + filter logic to install_scripts(); pass script_type through in MarkdownIntegration, TomlIntegration, and SkillsIntegration setup() methods
  • integrations/forge/__init__.py — same one-line fix in ForgeIntegration.setup() (overrides setup() directly, so wasn't covered by the base class change)

Testing

  • Ran existing tests with uv sync && uv run pytest
  • Tested with a sample project: specify-af init --here --ai claude --script sh --force no longer generates update-context.ps1

AI Disclosure

  • I did use AI assistance (describe below)

Claude Code (claude-sonnet-4-6) identified the root cause, implemented the fix, and updated tests.

…up() methods

install_scripts() accepted a script_type filter but callers in MarkdownIntegration,
TomlIntegration, SkillsIntegration, and ForgeIntegration all called it without
passing the type, so both .sh and .ps1 files were always copied regardless of
the --script flag. Pass script_type through in each setup() method.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant