mirror of
https://github.com/ellie/atuin.git
synced 2024-09-11 13:15:23 +03:00
chore: Set ATUIN_ variables for development in devshell (#1653)
I accidentially broke my atuin database by executing `atuin` from the PR I was working on without setting these variables and had to manually roll back my local database. That shouldn't happen, so we set the database and record store path in the devshell to something that does not overwrite our normal databases. We also warn if these files already exist, because when entering the devshell, a user might want to start from a clean slate here. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
335f2220c3
commit
8e520b1d72
14
flake.nix
14
flake.nix
@ -30,6 +30,20 @@
|
||||
rustfmt
|
||||
];
|
||||
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
|
||||
|
||||
shellHook = ''
|
||||
echo >&2 "Setting development database path"
|
||||
export ATUIN_DB_PATH="/tmp/atuin_dev.db"
|
||||
export ATUIN_RECORD_STORE_PATH="/tmp/atuin_records.db"
|
||||
|
||||
if [ -e "''${ATUIN_DB_PATH}" ]; then
|
||||
echo >&2 "''${ATUIN_DB_PATH} already exists, you might want to double-check that"
|
||||
fi
|
||||
|
||||
if [ -e "''${ATUIN_RECORD_STORE_PATH}" ]; then
|
||||
echo >&2 "''${ATUIN_RECORD_STORE_PATH} already exists, you might want to double-check that"
|
||||
fi
|
||||
'';
|
||||
});
|
||||
})
|
||||
// {
|
||||
|
Loading…
Reference in New Issue
Block a user