mickael9 / fac

Command-line mod manager for Factorio (install, update...)
MIT License
51 stars 18 forks source link

Update loop stops on first held mod that is updatable #24

Open NopeDK opened 5 years ago

NopeDK commented 5 years ago

Held mods update block uses break where it should use continue like the unpacked block.

                if not args.held and local_mod.name in self.config.hold:
                    print("%s is held. "
                          "Use -H to update it anyway." %
                          local_mod.name)
                    break

The above should use break like the on below does. Links above link to the relevant lines.

                if not args.unpacked and not local_mod.packed:
                    print(
                        "%s is unpacked. "
                        "Use -U to update it anyway." % (
                            local_mod.name
                        )
                    )
                    continue
Baughn commented 5 years ago

It's the last line in the for loop, so it doesn't need a continue. Removing the line entirely seems fine.

Really, I suppose the answer is to break up the function.

NopeDK commented 5 years ago

I am talking about the break at line 64, not the last line (67).

The break at 64 cancels the update function on the first package that can be updated but is held.

And yes, the very last break at line 67 shouldn't be there as well as that also ends the loop prematurely.