Skip to content

Support tilde (~) expansion in template paths#871

Merged
LasmarKhalifa merged 2 commits into
mainfrom
08-05/support-tilde-expansion-in-template-paths
May 12, 2026
Merged

Support tilde (~) expansion in template paths#871
LasmarKhalifa merged 2 commits into
mainfrom
08-05/support-tilde-expansion-in-template-paths

Conversation

@LasmarKhalifa
Copy link
Copy Markdown
Contributor

@LasmarKhalifa LasmarKhalifa commented May 8, 2026

Fixes #663

Paths with a tilde currently do not get expanded in the CogInputManager#template. This PR fixes that.

Adds File.expand_path candidates to the template path resolver so that ~/foo and ~user/foo resolve correctly.

Rescue block makes sure we don't crash when expanding ~something/foo (assuming "something" is not a real user) and fall back to the other candidates instead.

Added test coverage

Copy link
Copy Markdown
Contributor Author

LasmarKhalifa commented May 8, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@LasmarKhalifa LasmarKhalifa changed the title support tilde expansion in template paths Support tilde (~) expansion in template paths May 8, 2026
@LasmarKhalifa LasmarKhalifa marked this pull request as ready for review May 11, 2026 14:37
@LasmarKhalifa LasmarKhalifa force-pushed the 08-05/support-tilde-expansion-in-template-paths branch from 46c5019 to fd4c5a6 Compare May 11, 2026 15:29
@LasmarKhalifa LasmarKhalifa force-pushed the 08-05/support-tilde-expansion-in-template-paths branch from fd4c5a6 to 79f5c56 Compare May 11, 2026 15:30
Copy link
Copy Markdown
Contributor

@juniper-shopify juniper-shopify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking very good! Just a couple tweaks and I think it'd be good to add a few more test cases for completeness

Comment thread lib/roast/cog_input_manager.rb Outdated
Comment thread test/roast/cog_input_manager_test.rb Outdated
Comment thread test/roast/cog_input_manager_test.rb Outdated
Comment thread test/roast/cog_input_manager_test.rb Outdated
Comment thread test/roast/cog_input_manager_test.rb Outdated
Copy link
Copy Markdown
Contributor Author

Looking very good! Just a couple tweaks and I think it'd be good to add a few more test cases for completeness

Thanks for the feedback!! Did the requested changes 🚀

Copy link
Copy Markdown
Contributor

@juniper-shopify juniper-shopify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

Copy link
Copy Markdown
Contributor Author

LasmarKhalifa commented May 12, 2026

Merge activity

  • May 12, 8:30 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 12, 8:31 PM UTC: @LasmarKhalifa merged this pull request with Graphite.

@LasmarKhalifa LasmarKhalifa merged commit c50aed5 into main May 12, 2026
3 checks passed
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.

Support tilde (~) expansion in template paths

2 participants