File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,13 +24,14 @@ const rimrafAsync = promisify(rimraf);
2424 * @param {Object } opts
2525 */
2626export const buildLocale = async ( opts = { } ) => {
27- if ( ! fs . existsSync ( rootResolve ( 'src/locale' ) ) ) return ;
27+ const { localePath } = opts ;
28+ if ( ! fs . existsSync ( rootResolve ( localePath ) ) ) return ;
2829 printRow ( 'Start building locale files...' , { lineDown : 0 } ) ;
2930
3031 await rimrafAsync ( 'locale' ) ;
3132
3233 const localDst = rootResolve ( 'locale' ) ;
33- copyRecursiveSync ( rootResolve ( 'src/locale' ) , localDst ) ;
34+ copyRecursiveSync ( rootResolve ( localePath ) , localDst ) ;
3435
3536 // Create locale/index.js file
3637 let result = '' ;
Original file line number Diff line number Diff line change @@ -84,6 +84,11 @@ export const createCommands = (yargs) => {
8484 describe : 'Increase automatically the patch version' ,
8585 type : 'boolean' ,
8686 default : true ,
87+ } )
88+ . positional ( 'localePath' , {
89+ describe : 'Path to the directory containing locale files' ,
90+ type : 'string' ,
91+ default : 'src/locale' ,
8792 } ) ;
8893 webpackOptions ( yargs ) ;
8994 } , ( argv ) => build ( argv ) )
You can’t perform that action at this time.
0 commit comments