@@ -70,7 +70,6 @@ var __async = (__this, __arguments, generator) => {
7070// index.ts
7171var index_exports = { }
7272__export ( index_exports , {
73- CONFIG : ( ) => CONFIG ,
7473 LOCALE_LOGGER : ( ) => LOCALE_LOGGER ,
7574 ask : ( ) => ask ,
7675 default : ( ) => LOCALE_MODULE
@@ -143,7 +142,11 @@ var LOCALE_LOGGER = class {
143142 }
144143}
145144var LOCALE_MODULE = class {
146- constructor ( ) {
145+ constructor (
146+ path2 = this . CONFIG . LOGS_FILE ,
147+ ignoreUse = this . CONFIG . USE_GITIGNORE ,
148+ ignorePath = this . CONFIG . GITIGNORE_PATH
149+ ) {
147150 /**
148151 * The root directory of the module.
149152 * @type {string }
@@ -174,6 +177,25 @@ var LOCALE_MODULE = class {
174177 'PATTERNUGIT.NET'
175178 ] )
176179 __publicField ( this , 'LOGGER' , new LOCALE_LOGGER ( ) )
180+ /** **THIS IS A MAIN CONFIG FOR THIS SCRIPT
181+ * ONLY EDIT THIS VALUES.**
182+ **/
183+ __publicField ( this , 'CONFIG' , {
184+ USE_GITIGNORE : true ,
185+ /**
186+ * Path to your gitignore from the root, relative to
187+ * the script's directory.
188+ */
189+ GITIGNORE_PATH : './.gitignore' ,
190+ /**
191+ * Path to the future logs of the locale module: by default is static of
192+ * config's value.
193+ */
194+ LOGS_FILE : `preparations-${ /* @__PURE__ */ new Date ( ) . toLocaleDateString ( ) } .logs`
195+ } )
196+ this . CONFIG . LOGS_FILE = path2
197+ this . CONFIG . USE_GITIGNORE = ignoreUse
198+ this . CONFIG . GITIGNORE_PATH = ignorePath
177199 }
178200 /**
179201 * Updates the exclusion settings based on user input.
@@ -192,15 +214,15 @@ var LOCALE_MODULE = class {
192214 if ( actions === 'N' ) {
193215 this . EXCLUDING_FOLDERS = entries
194216 }
195- if ( CONFIG . USE_GITIGNORE ) {
217+ if ( this . CONFIG . USE_GITIGNORE ) {
196218 const gitignore = fs . readFileSync ( '.gitignore' ) . toString ( ) . split ( '\n' )
197219 gitignore . forEach ( ( line ) => {
198220 if ( line [ 0 ] !== '#' && line [ 0 ] !== '!' ) {
199221 this . EXCLUDING_FOLDERS . push ( line )
200222 }
201223 } )
202224 }
203- fs . ensureFileSync ( CONFIG . LOGS_FILE )
225+ fs . ensureFileSync ( this . CONFIG . LOGS_FILE )
204226 }
205227 /**
206228 * Searches for specified words in file contents.
@@ -211,7 +233,7 @@ var LOCALE_MODULE = class {
211233 search ( filepath , data ) {
212234 return __async ( this , null , function * ( ) {
213235 const buffer = yield fs . readFile ( filepath , { encoding : 'utf-8' } )
214- const stream = fs . createWriteStream ( CONFIG . LOGS_FILE , { flags : 'a' } )
236+ const stream = fs . createWriteStream ( this . CONFIG . LOGS_FILE , { flags : 'a' } )
215237 const contents = buffer . split ( os . EOL )
216238 for ( let i = 0 ; i < contents . length ; i ++ ) {
217239 const line = contents [ i ] . toUpperCase ( )
@@ -255,11 +277,6 @@ var LOCALE_MODULE = class {
255277 } )
256278 }
257279}
258- var CONFIG = {
259- USE_GITIGNORE : true ,
260- GITIGNORE_PATH : './.gitignore' ,
261- LOGS_FILE : `preparations-${ /* @__PURE__ */ new Date ( ) . toLocaleDateString ( ) } .logs`
262- }
263280var ask = ( rl , question ) =>
264281 __async ( null , null , function * ( ) {
265282 return yield new Promise ( ( resolve ) => {
@@ -272,6 +289,7 @@ void (() =>
272289 input : process . stdin ,
273290 output : process . stdout
274291 } )
292+ void ( ( ) => __async ( null , null , function * ( ) { } ) )
275293 try {
276294 const finder = new LOCALE_MODULE ( )
277295 const mode = yield ask ( RL , colors . bgBlue ( colors . yellow ( 'Add custom entries (Y/N/IGNORE): ' ) ) )
0 commit comments