Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Commit

Permalink
Fix paths so messages go into messagesDir
Browse files Browse the repository at this point in the history
  • Loading branch information
toadzky authored and ericf committed Feb 6, 2016
1 parent 0a56e3c commit 5f2fe57
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,16 @@ export default function () {
file.metadata['react-intl'] = {messages: descriptors};

if (opts.messagesDir && descriptors.length > 0) {
// Make sure the relative path is "absolute" before
// joining it with the `messagesDir`.
let relativePath = p.join(
path.sep,
p.relative(process.cwd(), filename)
);

let messagesFilename = p.join(
opts.messagesDir,
p.dirname(p.relative(process.cwd(), filename)),
p.dirname(relativePath),
basename + '.json'
);

Expand Down

0 comments on commit 5f2fe57

Please sign in to comment.