fix: correct absolute path creation in create-tool script - #370
Open
Devendra8839 wants to merge 1 commit into
Open
fix: correct absolute path creation in create-tool script #370Devendra8839 wants to merge 1 commit into
Devendra8839 wants to merge 1 commit into
Conversation
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.
Description
This PR fixes an issue in the
create-toolscaffold script where tool generation failed on Unix-based systems due to incorrect absolute path handling.Problem
Running the scaffold generator command resulted in partially created directories followed by an
ENOENTerror during file creation.Example failure:
The issue occurred because recursive directory creation was initialized using a relative root (
.) even when processing absolute paths.As a result, directories were incorrectly generated as relative paths such as:
instead of the expected absolute paths:
This caused subsequent scaffold files (such as
index.tsx) to fail during creation because the target absolute directory structure did not actually exist.Root Cause
Inside
createFolderStructure(), recursive folder creation was initialized with:Using
.as the starting base path caused absolute path segments to be resolved relative to the current working directory during recursive joins.Fix
The recursive creation process now starts from the filesystem root using:
This ensures absolute paths are preserved correctly during recursive directory creation and allows the scaffold generator to successfully create all required files and directories on Unix-based systems.