-
Notifications
You must be signed in to change notification settings - Fork 748
[Bug] - Incorrectly handled absolute paths #1064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mishushakov
wants to merge
27
commits into
main
Choose a base branch
from
fix-abs-up-paths
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
1a256cb
added tests
mishushakov 2c756cf
added tests
mishushakov eb41e1a
fix abs and ../ file upload in JS
mishushakov b64e8c2
simplify implementation
mishushakov 044fc37
added tests, updated implementation
mishushakov be81cb7
added changeset
mishushakov c7dfb53
fixes logic
mishushakov aaf2d1c
perserve absolute file paths
mishushakov 5d3aed1
updated impl
mishushakov 2a98000
forward js gzip stream errors
mishushakov bc2cc16
update rewrite_src signature (python)
mishushakov ba5213f
updated path handling
mishushakov 7945dcd
updated js tests
mishushakov e917560
updated tests, normalize path python
mishushakov 3542b2e
fix windows tests
mishushakov 91b18be
fixes js tests on window, normalize paths on rewrite
mishushakov 3a3cf70
normalize glob pattern
mishushakov ee21f6c
sync python version
mishushakov 435ec35
format & lint
mishushakov 357a65b
normalize glob path in python (windows)
mishushakov 3ea8d7c
normalize path on windows for wcmatch
mishushakov fe1a9f5
simplified js implementation, removed unused stat
mishushakov abd00bd
updated python impl
mishushakov 739edf7
undo file change
mishushakov 751dbcc
add trailing newline
mishushakov c707e7d
fmt
mishushakov 451105a
sync path normalization code
mishushakov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| '@e2b/python-sdk': patch | ||
| 'e2b': patch | ||
| --- | ||
|
|
||
| added handling for absolute file paths (/) and up paths (../) |
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { expect, test, describe } from 'vitest' | ||
| import { rewriteSrc } from '../../../src/template/utils' | ||
|
|
||
| describe('rewriteSrc', () => { | ||
| test('should return basename for parent directory paths', () => { | ||
| expect(rewriteSrc('../file.txt')).toBe('file.txt') | ||
| expect(rewriteSrc('../../config.json')).toBe('config.json') | ||
| expect(rewriteSrc('../dir/file.py')).toBe('file.py') | ||
| }) | ||
|
|
||
| test('should preserve relative paths', () => { | ||
| expect(rewriteSrc('file.txt')).toBe('file.txt') | ||
| expect(rewriteSrc('dir/file.txt')).toBe('dir/file.txt') | ||
| expect(rewriteSrc('./file.txt')).toBe('./file.txt') | ||
| expect(rewriteSrc('src/components/Button.tsx')).toBe( | ||
| 'src/components/Button.tsx' | ||
| ) | ||
| }) | ||
|
|
||
| test('should preserve absolute paths', () => { | ||
| expect(rewriteSrc('/usr/local/file.txt')).toBe('/usr/local/file.txt') | ||
| expect(rewriteSrc('/home/user/project/file.py')).toBe( | ||
| '/home/user/project/file.py' | ||
| ) | ||
| }) | ||
|
|
||
| test('should handle glob patterns', () => { | ||
| expect(rewriteSrc('*.txt')).toBe('*.txt') | ||
| expect(rewriteSrc('**/*.py')).toBe('**/*.py') | ||
| expect(rewriteSrc('../*.txt')).toBe('*.txt') | ||
| }) | ||
| }) |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.