Skip to content

Commit 2dabc00

Browse files
author
Gertjan Reynaert
committed
feat(Paths): Add support for absolute paths
Remove incorrect usage of Path.join and thus enable the usage of absolute paths BREAKING CHANGE: Might break incorrect relative paths that were previously corrected by Path.join Closes #6
1 parent a4695f1 commit 2dabc00

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

src/createSingleMessagesFile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default ({
1313
throw new Error('Directory is required');
1414
}
1515

16-
const DIR = Path.join('./', directory, fileName);
16+
const DIR = Path.join(directory, fileName);
1717

1818
writeFileSync(DIR, JSON.stringify(messages, null, jsonSpaceIndentation));
1919
};

src/manageTranslations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ export default ({
4848
}
4949
},
5050
beforeReporting: () => {
51-
mkdirpSync(Path.join('./', translationsDirectory));
52-
mkdirpSync(Path.join('./', whitelistsDirectory));
51+
mkdirpSync(translationsDirectory);
52+
mkdirpSync(whitelistsDirectory);
5353
},
5454
provideLangTemplate: lang => {
5555
const languageFilename = `${lang}.json`;

src/readMessageFiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default messagesDirectory => {
1111
throw new Error('messagesDirectory is required');
1212
}
1313

14-
const EXTRACTED_MESSAGES_DIR = Path.join('./', messagesDirectory, '/');
14+
const EXTRACTED_MESSAGES_DIR = Path.join(messagesDirectory, '/');
1515
const EXTRACTED_MESSAGES = Path.join(EXTRACTED_MESSAGES_DIR, '**/*.json');
1616

1717
return globSync(EXTRACTED_MESSAGES)

test/path.test.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)