-
-
Notifications
You must be signed in to change notification settings - Fork 417
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
make --out-dir generate correct dir path with absolute path #208
Conversation
This pull request is automatically deployed with Now. |
Codecov Report
@@ Coverage Diff @@
## master #208 +/- ##
=======================================
Coverage 85.57% 85.57%
=======================================
Files 24 24
Lines 520 520
Branches 103 103
=======================================
Hits 445 445
Misses 67 67
Partials 8 8 Continue to review full report at Codecov.
|
packages/cli/src/dirCommand.js
Outdated
@@ -50,7 +50,10 @@ async function dirCommand( | |||
if (!isCompilable(relative)) return false | |||
relative = rename(relative, ext, filenameCase) | |||
|
|||
const dest = path.join(program.outDir, relative) | |||
const dest = program.outDir.startsWith('/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not always using path.resolve()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I've removed the condition and always use path.resolve()
here.
Thanks! |
Summary
Input:
svgr --ext=tsx --out-dir=/Users/rrli/Downloads "/Users/rrli/Downloads/Group6.svg"
,Expected: "/Users/rrli/Download/Group6.svg"
Actual: "/Users/rrli/Downloads/Users/rrli/Downloads/Group6.tsx"
Test plan