Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:firefly-iii/data-importer into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
JC5 committed Nov 17, 2024
2 parents ed13b35 + 893f9c8 commit e3a1dc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/Console/AutoImports.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private function importFiles(string $directory, array $files): array
$this->importMessages = [];
$this->importWarnings = [];
}
Log::debug(sprintf('Collection of exit codes: %s', join(', ', array_values($exitCodes))));
Log::debug(sprintf('Collection of exit codes: %s', implode(', ', array_values($exitCodes))));

return $exitCodes;
}
Expand Down Expand Up @@ -222,6 +222,7 @@ private function importFile(string $directory, string $file): int
if (!$jsonFileExists && !$hasFallbackConfig) {
$this->error(sprintf('No JSON configuration found. Checked for both "%s" and "%s"', $jsonFile, $fallbackJsonFile));
app('log')->error(sprintf('Exit code is %s.', ExitCode::CANNOT_READ_CONFIG->name));

return ExitCode::CANNOT_READ_CONFIG->value;
}

Expand All @@ -236,6 +237,7 @@ private function importFile(string $directory, string $file): int
$message = sprintf('The importer can\'t import %s: could not decode the JSON in config file %s.', $importableFile, $jsonFile);
$this->error($message);
app('log')->error(sprintf('Exit code is %s.', ExitCode::CANNOT_PARSE_CONFIG->name));

return ExitCode::CANNOT_PARSE_CONFIG->value;
}
$configuration = Configuration::fromArray(json_decode(file_get_contents($jsonFile), true));
Expand All @@ -246,6 +248,7 @@ private function importFile(string $directory, string $file): int

// don't report this.
app('log')->debug(sprintf('Exit code is %s.', ExitCode::SUCCESS->name));

return ExitCode::SUCCESS->value;
}

Expand All @@ -270,6 +273,7 @@ private function importFile(string $directory, string $file): int
)
);
app('log')->debug(sprintf('Exit code is %s.', ExitCode::TOO_MANY_ERRORS_PROCESSING->name));

return ExitCode::TOO_MANY_ERRORS_PROCESSING->value;
}

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function handle(): int
$exitCode = ExitCode::NOTHING_WAS_IMPORTED->value;
app('log')->error(sprintf('Exit code is %s.', ExitCode::NOTHING_WAS_IMPORTED->name));
}
if($exitCode === ExitCode::SUCCESS->value) {
if ($exitCode === ExitCode::SUCCESS->value) {
app('log')->debug(sprintf('Exit code is %s.', ExitCode::SUCCESS->name));
}

Expand Down

0 comments on commit e3a1dc6

Please sign in to comment.