File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments