fix: normalize path separators in devvit create icons asset names#250
Open
mvanhorn wants to merge 1 commit intoreddit:mainfrom
Open
fix: normalize path separators in devvit create icons asset names#250mvanhorn wants to merge 1 commit intoreddit:mainfrom
mvanhorn wants to merge 1 commit intoreddit:mainfrom
Conversation
Fixes reddit#129 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
niedzielski
approved these changes
Mar 19, 2026
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
Normalizes path separators in asset names generated by
devvit create iconsso they use forward slashes on all platforms.Why this matters
#129 reports that on Windows,
devvit create iconsproduces asset names with backslashes (e.g.,subfolder\icon.svg) becausepath.relative()uses the OS path separator. This results in escape sequences in the generated TypeScript file, breaking asset lookups.The fix pattern already exists in the same file on line 52 (
.replaceAll(path.sep, '/')) for the glob path, and inAssetUploader.tslines 607 and 613 for the same purpose. This PR applies the same normalization to the asset name.Changes
In
packages/cli/src/commands/create/icons.tsline 59, added.replaceAll(path.sep, '/')to thepath.relative()call that generates asset names.Testing
This matches an established pattern used in 3 other places in the codebase for the same purpose. On non-Windows systems,
path.sepis already/so the call is a no-op.Fixes #129
This contribution was developed with AI assistance (Claude Code + Codex CLI).