Parse operation configs only if they are specified
This fixes a bug where duplicacy-util tries to parse configurations for all operations, even when they aren't specified. Now each configuration is only parsed when the corresponding cmd* flag is passed. It does not change any behavior for the end user.
performBackup() in backup-ops.go correctly honors these flags already, so not parsing the configs should not break anything.
Looks like the config unit tests need some additional work since these flags aren't passed there
Updated the unit tests to set the required flags, but do they need to be outside the function so that they are guaranteed to be available everywhere? I'm not sure how golang's testing works as far as threading and such.
Codecov Report
Merging #52 into master will decrease coverage by
0.06%. The diff coverage is51.11%.
@@ Coverage Diff @@
## master #52 +/- ##
==========================================
- Coverage 40.36% 40.29% -0.07%
==========================================
Files 12 12
Lines 934 938 +4
==========================================
+ Hits 377 378 +1
- Misses 515 517 +2
- Partials 42 43 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| configBackup.go | 51.79% <51.11%> (+1.42%) |
:arrow_up: |
| timeutils.go | 79.03% <0.00%> (-4.84%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update ef85279...eb2f8b0. Read the comment docs.