Skip to content

Commit 5160bf9

Browse files
[DURACOM-426] revert changes to sync script
1 parent a15ad30 commit 5160bf9

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

scripts/sync-i18n-files.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,14 @@ function parseCliInput() {
3737
.option('-o, --output-file <output>', 'where output of script ends up; mutually exclusive with -i')
3838
.usage('([-d <output-dir>] [-s <source-file>]) || (-t <target-file> (-i | -o <output>) [-s <source-file>])')
3939
.parse(process.argv);
40-
if (!program.targetFile) {
40+
41+
const sourceFile = program.opts().sourceFile;
42+
43+
if (!program.targetFile) {
4144
fs.readdirSync(projectRoot(LANGUAGE_FILES_LOCATION)).forEach(file => {
42-
if (program.opts().sourceFile && !program.opts().sourceFile.toString().endsWith(file)) {
45+
if (!sourceFile.toString().endsWith(file)) {
4346
const targetFileLocation = projectRoot(LANGUAGE_FILES_LOCATION + "/" + file);
44-
console.log('Syncing file at: ' + targetFileLocation + ' with source file at: ' + program.opts().sourceFile);
47+
console.log('Syncing file at: ' + targetFileLocation + ' with source file at: ' + sourceFile);
4548
if (program.outputDir) {
4649
if (!fs.existsSync(program.outputDir)) {
4750
fs.mkdirSync(program.outputDir);
@@ -66,7 +69,7 @@ function parseCliInput() {
6669
console.log(program.outputHelp());
6770
process.exit(1);
6871
}
69-
if (!checkIfFileExists(program.opts().sourceFile)) {
72+
if (!checkIfFileExists(sourceFile)) {
7073
console.error('Path of source file is not valid.');
7174
console.log(program.outputHelp());
7275
process.exit(1);

0 commit comments

Comments
 (0)