Skip to content

Commit

Permalink
Settings: Fix setting not being applied correctly, Lang: add missing key
Browse files Browse the repository at this point in the history
  • Loading branch information
themitosan committed Dec 16, 2024
1 parent b2db154 commit 2bb97f1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
4 changes: 3 additions & 1 deletion Lang/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"noArgsProvided": "==> Visto que nenhum argumento foi passado, desejamos que uma bela pessoa com o nome %VAR_0% tenha um ótimo dia! <3\n",

"unableGetNpmRootPath": "ERRO - Não foi possível obter o local de instalação global do NPM!\nMotivo: %VAR_0%",
"unableGetNpmRootPath_notFound": "Caminho não encontrado! (%VAR_0%)"
"unableGetNpmRootPath_notFound": "Caminho não encontrado! (%VAR_0%)",

"warnRepoNotFound": "AVISO - Não foi possível encontrar %VAR_0% no banco de dados!"

},

Expand Down
4 changes: 3 additions & 1 deletion src/lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export var langDatabase:any = {
"noArgsProvided": "==> Since no args / flags were provided, We wish someone called %VAR_0% a great day! <3\n",

"unableGetNpmRootPath": "ERROR - Unable to get NPM root path!\nReason: %VAR_0%",
"unableGetNpmRootPath_notFound": "Path not found! (%VAR_0%)"
"unableGetNpmRootPath_notFound": "Path not found! (%VAR_0%)",

"warnRepoNotFound": "WARN - Unable to find %VAR_0% on repo database!"

},

Expand Down
12 changes: 6 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export function grpp_removeRepo(path:string){
delete grppSettings.repoEntries[path];
grpp_saveSettings();
} else {
createLogEntry(`WARN - Unable to find ${path} on repo database!`, 'warn');
createLogEntry(grpp_convertLangVar(langDatabase.main.warnRepoNotFound, [path]), 'warn');
}
resolve();
});
Expand Down Expand Up @@ -378,7 +378,7 @@ async function init(){
// Set max repos a batch file should have
if (currentArg.indexOf('maxReposPerList=') !== -1){
tempSettings.maxReposPerList = preventMinMax(Math.floor(Number(currentArg.replace('maxReposPerList=', ''))), 1, maxValue);
grpp_saveSettings();
execFn = grpp_saveSettings;
}

// User settings: Set lang
Expand All @@ -387,25 +387,25 @@ async function init(){
// Set max fetch pages
if (currentArg.indexOf('setMaxFetchPages=') !== -1){
tempSettings.maxPages = preventMinMax(Math.floor(Number(currentArg.replace('setMaxFetchPages=', ''))), 1, maxValue);
grpp_saveSettings();
execFn = grpp_saveSettings;
}

// Set web test url
if (currentArg.indexOf('setConnectionTestURL=') !== -1){
tempSettings.connectionTestURL = currentArg.replace('setConnectionTestURL=', '');
grpp_saveSettings();
execFn = grpp_saveSettings;
}

// Set starting fetch page
if (currentArg.indexOf('setStartPage=') !== -1){
tempSettings.fetchStartPage = preventMinMax(Math.floor(Number(currentArg.replace('setStartPage=', ''))), 0, maxValue);
grpp_saveSettings();
execFn = grpp_saveSettings;
}

// Set text editor
if (currentArg.indexOf('setEditor') !== -1){
tempSettings.userEditor = currentArg.replace('setEditor=', '');
grpp_saveSettings();
execFn = grpp_saveSettings;
}

// Set GRPP path
Expand Down
3 changes: 1 addition & 2 deletions src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ export async function grpp_processBatchFile(id:number){
for (const repoIndex in batchFile.batchList[id]){

// Process current repo and output current status
const repoEntry = batchFile.batchList[id][repoIndex];
await grpp_updateRepo(repoEntry).then(function(){
await grpp_updateRepo(batchFile.batchList[id][repoIndex]).then(function(){

// Reset chdir and create / update current process result
process.chdir(originalCwd);
Expand Down

0 comments on commit 2bb97f1

Please sign in to comment.