Honor CASINO_CONFIG_DIR and CASINO_DATA_DIR #47
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#51 Record how the casino finds its files
rosa/casino
#45 Give the config module a home to load from
rosa/casino
Reference
rosa/casino#47
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
Let a player point the casino at a different home through the environment:
CASINO_CONFIG_DIRandCASINO_DATA_DIR, each falling back to the system'susual place when unset. The reading belongs inside the constructor that asks
where a user's files go — the binary should not be the only thing that knows
what the variables are called.
This is what makes end-to-end tests possible at all.
assert_cmd,assert_fs,and
predicatesare already dev-dependencies and nothing in the tree uses them;there is no test directory. Put them to work on the two things unit tests
cannot reach, because they are claims about the built binary rather than about a
function: that it honors the variables, and that a first run against an empty
home leaves a readable config behind.
Deliberately not in scope: a non-interactive flag for
purge. Its decisions arecovered as a value by the housekeeping ticket, so an end-to-end purge test would
re-cover that ground while adding a feature invented to serve a test.
Relying on
XDG_CONFIG_HOMEinstead was considered and rejected — the directorycrate honors it on Linux and ignores it on macOS, so a suite built on it would
pass in CI while quietly pointing at a real home elsewhere.
Acceptance criteria
today
written on first run
Blocked by
XDG data dirs are fine
@rosa wrote in #47 (comment):
actually scratch that