Skip to content

Commit

Permalink
silence warning if NIX_INDEX_DATABASE is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Mar 10, 2024
1 parent 9d8bcc3 commit 1e1f6bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ pub fn check_database_exists() {

/// Prints a warning if the nix-index database is out of date.
pub fn check_database_updated() {
if os::getenv("NIX_INDEX_DATABASE").is_some() {
// If the user has set NIX_INDEX_DATABASE, they are responsible for keeping it up to date
// because if it's part of the nix store, the timestamp be always 1970-01-01.
// This environment variable is set by nix-index-database.
return;
}
let database_file = get_database_file();
if is_database_old(&database_file) {
eprintln!(
Expand Down

0 comments on commit 1e1f6bc

Please sign in to comment.