Closed
Conversation
Ensure `.icp/data/` is tracked in version control for all new projects, regardless of whether the template (including community templates) includes the file. The file is only created if not already present. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
raymondk
reviewed
Mar 16, 2026
| .expect(".icp/data/.gitkeep always has a parent"), | ||
| ) | ||
| .context("Failed to create .icp/data directory")?; | ||
| icp::fs::write(&gitkeep, &[]).context("Failed to create .icp/data/.gitkeep")?; |
Contributor
There was a problem hiding this comment.
You don't want to write some text in it that explains what it is ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
icp newnow always creates.icp/data/.gitkeepin the generated project after template rendering.icp/data/(which stores mainnet canister ID mappings) is tracked in version control regardless of whether the template includes the file — covering both official and community templatesTest plan
new_injects_gitkeep_when_template_does_not_have_one— verifies the file is created when the template omits itnew_succeeds_when_template_already_has_gitkeep— verifies idempotency when the template already includes the file🤖 Generated with Claude Code