node-translation-scripts
Advanced tools
| const path = require("path"); | ||
| const __rootDirname = path.join("../", __dirname); | ||
| const __rootDirname = process.env.dp0.split('\\node_modules\\')[0] | ||
| module.exports = __rootDirname; |
+1
-1
| { | ||
| "name": "node-translation-scripts", | ||
| "description": "i18n translation cli scripts", | ||
| "version": "1.0.6", | ||
| "version": "1.0.7", | ||
| "main": "cli.js", | ||
@@ -6,0 +6,0 @@ "bin": { |
@@ -31,6 +31,6 @@ /* eslint-disable */ | ||
| if (!fs.existsSync(outputDirectory)) { | ||
| fs.mkdirSync(outputDirectory) | ||
| fs.mkdirSync(outputDirectory, { recursive: true }) | ||
| } else { | ||
| deleteFolder(outputDirectory) | ||
| fs.mkdirSync(outputDirectory) | ||
| fs.mkdirSync(outputDirectory, { recursive: true }) | ||
| } | ||
@@ -53,5 +53,6 @@ } | ||
| process.stdout.write( | ||
| 'Translation path "' + translationPath + '" path doesn\'t exist.' | ||
| 'Translation path "' + translationPath + '" path doesn\'t exist. Empty folder created\n' | ||
| ) | ||
| exitProcess(1) | ||
| fs.mkdirSync(translationPath, { recursive: true }) | ||
| } | ||
@@ -75,3 +76,3 @@ }) | ||
| if (!dry) { | ||
| fs.mkdirSync(path.join(outputDirectory, referenceLanguageName)) | ||
| fs.mkdirSync(path.join(outputDirectory, referenceLanguageName), { recursive: true }) | ||
| fs.writeFileSync( | ||
@@ -86,3 +87,3 @@ path.join(outputDirectory, referenceLanguageName, 'translation.json'), | ||
| if (!dry) { | ||
| fs.mkdirSync(path.join(outputDirectory, language)) | ||
| fs.mkdirSync(path.join(outputDirectory, language), { recursive: true }) | ||
| } | ||
@@ -89,0 +90,0 @@ |
@@ -47,2 +47,4 @@ /* eslint-disable */ | ||
| console.log(outputLanguageDirectory) | ||
| if (!dry) { | ||
@@ -52,3 +54,3 @@ if (fs.existsSync(outputLanguageDirectory)) { | ||
| } | ||
| fs.mkdirSync(outputLanguageDirectory) | ||
| fs.mkdirSync(outputLanguageDirectory, { recursive: true }) | ||
| } | ||
@@ -55,0 +57,0 @@ |
@@ -8,3 +8,3 @@ /* eslint-disable */ | ||
| return argv.inputDirectory || argv.i | ||
| ? path.join(__rootDirname, '../../', argv.inputDirectory || argv.i) | ||
| ? path.join(__rootDirname, argv.inputDirectory || argv.i) | ||
| : false | ||
@@ -11,0 +11,0 @@ } |
@@ -8,3 +8,3 @@ /* eslint-disable */ | ||
| return argv.outputDirectory || argv.o | ||
| ? path.join(__rootDirname, "../../", argv.outputDirectory || argv.o) | ||
| ? path.join(__rootDirname, argv.outputDirectory || argv.o) | ||
| : false; | ||
@@ -11,0 +11,0 @@ } |
@@ -8,3 +8,3 @@ /* eslint-disable */ | ||
| return argv.refLanguagePath || argv.r | ||
| ? path.join(__rootDirname, '../../', argv.refLanguagePath || argv.r) | ||
| ? path.join(__rootDirname, argv.refLanguagePath || argv.r) | ||
| : false | ||
@@ -11,0 +11,0 @@ } |
@@ -11,3 +11,3 @@ /* eslint-disable */ | ||
| return translationPaths.split(',').map(item => { | ||
| return path.join(__rootDirname, '../../', item) | ||
| return path.join(__rootDirname, item) | ||
| }) | ||
@@ -14,0 +14,0 @@ } else { |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
20742
0.97%502
0.2%9
12.5%