go-shiori / shiori

Simple bookmark manager built with Go
MIT License
9.28k stars 551 forks source link

fix: override configuration from flags only if set #865

Closed fmartingr closed 6 months ago

fmartingr commented 6 months ago

This pull request checks if the flags provided to the server command has been set (are changed from the default values) before overriding the configuration with their values.

This fixes the configuration not being able to work when using only environment variables, since the default values were always overriden by the flags, regardless of being set up or not.

Ping @tenpai-git

Closes #844

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 0% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 25.55%. Comparing base (595cb45) to head (397b772). Report is 4 commits behind head on master.

:exclamation: Current head 397b772 differs from pull request most recent head 3a929c6. Consider uploading reports for the commit 3a929c6 to get more accurate results

Files Patch % Lines
internal/cmd/server.go 0.00% 19 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #865 +/- ## ========================================== - Coverage 25.58% 25.55% -0.04% ========================================== Files 47 47 Lines 5628 5636 +8 ========================================== Hits 1440 1440 - Misses 3989 3997 +8 Partials 199 199 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

fmartingr commented 6 months ago

LGTM and work fine in my system can you check codecov error before merge this it decrease coverage

Going to merge this for now so we can release a new dot version. I need to take a look at viper or something that allows us to have both flag and envvars easily.