Skip to content

Commit

Permalink
Convert paths to relative
Browse files Browse the repository at this point in the history
Recent babel versions always use absolute paths (babel/babel#8044)
  • Loading branch information
ThiefMaster committed Jun 6, 2018
1 parent cfd7a86 commit 3869ca5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/tools/extract-plugin.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {relative} from 'path';
import cleanJSXElementLiteralChild from '@babel/types/lib/utils/react/cleanJSXElementLiteralChild';


Expand Down Expand Up @@ -75,7 +76,8 @@ const processTranslatableElement = (path, types) => {


const getLocation = (path, state) => {
return `${state.file.opts.filename}:${path.node.loc.start.line}`;
const filename = relative(process.cwd(), state.file.opts.filename);
return `${filename}:${path.node.loc.start.line}`;
};


Expand Down
2 changes: 1 addition & 1 deletion src/tools/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const extractFromFiles = (files, headers = undefined, highlightErrors = true) =>
});
} catch (exc) {
// babel errors already contain the file name
errors.push(exc.message);
errors.push(exc.message.replace(process.cwd() + '/', ''));
}
});

Expand Down

0 comments on commit 3869ca5

Please sign in to comment.