Path with double context in windows for --add option
See original GitHub issueI think I found a bug.
When I launch :
npx vue-i18n-extract report -v "./src/**/*.?(vue)" -l "./src/locales/**/*.json" -a
I got this result :
ectory, open 'C:\repoC:\repo\src\locales\en.json'
at Object.openSync (fs.js:462:3)
at Object.writeFileSync (fs.js:1384:35)
at C:\laragon\www\oklinda\node_modules\vue-i18n-extract\dist\vue-i18n-extrac
t.umd.js:189:12
Here is the fix I did :
In vue-i18n-extract.umd.js
line 185
function writeMissingToLanguage(resolvedLanguageFiles, missingKeys) {
const languageFiles = readLangFiles(resolvedLanguageFiles);
[...]
const fileExtension = languageFile.fileName.substring(languageFile.fileName.lastIndexOf('.') + 1);
const filePath = path.resolve(process.cwd() + languageFile.fileName);
const stringifiedContent = JSON.stringify(languageFileContent, null, 2);
[...}
});
}
Remove the process.cwd()
as the path are already in the context.
function writeMissingToLanguage(resolvedLanguageFiles, missingKeys) {
const languageFiles = readLangFiles(resolvedLanguageFiles);
[...]
const fileExtension = languageFile.fileName.substring(languageFile.fileName.lastIndexOf('.') + 1);
const filePath = path.resolve(languageFile.fileName);
const stringifiedContent = JSON.stringify(languageFileContent, null, 2);
[...}
});
}
Now it works for me.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
Add "Add To Path" To Context Menu - Itechtics
In this article the method of adding path to context menu will be ... then double click AddPathEntries.reg and accept the window prompt...
Read more >Add "Add to Path" to context menu - windows 10 - Super User
Since setx sets the user path and not the system path, the command mentioned in my question will add all elements in the...
Read more >adding a shell context menu item so that I can add folder to ...
I just spent the last 6+ hours of my life trying to be able to add a directory to my path (permanently) from...
Read more >Add Or Remove Any Folder To PATH Variable Using Windows ...
Ever wished you could just right-click a folder and have the option in the context menu to add it to the PATH variable?...
Read more >Migrations with Multiple Providers - EF Core - Microsoft Learn
One way to create multiple migration sets is to use one DbContext type per provider. ... Specify the context type when adding new...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If I try to do it in linux I find the following error:
It’s a typo; you must use
,
withpath.resolve
not+
…It has been solved in #94, update to version 1.1.11.