cal-itp/littlepay

Current config path file is not created with custom config_path arg

Closed this issue · 0 comments

See the recent failures in benefits for a reproduction: https://github.com/cal-itp/benefits/actions/runs/8390023580

In a fresh environment, when calling littlepay config config_path.yaml

The code does not go through the pathway of ensuring the .current file (defaulting to ~/.littlepay/.current) exists.

This was previously hidden by the erroneous top-level config = Config() in e.g. littlepay.commands.groups, which was always being executed first.

Without arguments, Config() goes through the _get_current_path() helper, which ensures the .current file exists

Expected behavior

Calling littlepay config config_path.yaml in a fresh environment should ensure the .current file exists in the default location ~/.littlepay.

There should not be an error and .current should be written to point to the provided config_path.yaml.