File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
src/scripts/crowdin/translations Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -58,8 +58,22 @@ export const createLocaleTranslationPR = (
58
58
} ) . trim ( )
59
59
execSync ( `git checkout -b ${ branchName } ` )
60
60
execSync ( "git reset ." )
61
- execSync ( `git add ${ TRANSLATIONS_DIR } /${ locale } ` )
62
- execSync ( `git add ${ INTL_JSON_DIR } /${ locale } ` )
61
+
62
+ // Check if the translations directory exists and contains files
63
+ const translationsDir = path . join ( TRANSLATIONS_DIR , locale )
64
+ if (
65
+ fs . existsSync ( translationsDir ) &&
66
+ fs . readdirSync ( translationsDir ) . length > 0
67
+ ) {
68
+ execSync ( `git add ${ translationsDir } ` )
69
+ }
70
+
71
+ // Check if the intl JSON directory exists and contains files
72
+ const intlJsonDir = path . join ( INTL_JSON_DIR , locale )
73
+ if ( fs . existsSync ( intlJsonDir ) && fs . readdirSync ( intlJsonDir ) . length > 0 ) {
74
+ execSync ( `git add ${ intlJsonDir } ` )
75
+ }
76
+
63
77
execSync ( `git commit -m "${ message } "` )
64
78
execSync ( `git push origin ${ branchName } ` )
65
79
You can’t perform that action at this time.
0 commit comments