Skip to content
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

Merged
merged 1 commit into from
Nov 4, 2018

Conversation

reeli
Copy link
Contributor

@reeli reeli commented Oct 15, 2018

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

@vercel
Copy link

vercel bot commented Oct 15, 2018

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

@codecov
Copy link

codecov bot commented Oct 15, 2018

Codecov Report

Merging #208 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 514d43d...c5c73f7. Read the comment docs.

@@ -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('/')
Copy link
Owner

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()?

Copy link
Contributor Author

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.

@gregberge gregberge merged commit c922e2e into gregberge:master Nov 4, 2018
@gregberge
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants