From 9690ac5974c3f57b582c65ecbd876583075ee5f2 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 21 Oct 2018 11:12:11 -0700 Subject: [PATCH] Rename fish_universal_variables file to fish_variables This is to avoid development versions of fish 3.0 freaking out when the file format is changed. We now have better support for for future universal variable formats so it's unlikely we'll have to change the file name again. --- CHANGELOG.md | 2 +- src/env_universal_common.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2b0e7c00..b9260e29d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,7 +39,7 @@ fish 3.0 is a major release which brings with it both improvements in functional - `while` sets `$status` to a more useful value (#4982) - Command substitution output is now limited to 10 MB by default (#3822). - The machine hostname, where available, is now exposed as `$hostname` which is now a reserved variable. This drops the dependency on the `hostname` executable (#4422). -- The universal variables file no longer contains the MAC address. It is now at the fixed location `.config/fish/fish_universal_variables` (#1912). +- The universal variables file no longer contains the MAC address. It is now at the fixed location `.config/fish/fish_variables` (#1912). - Bare `bind` invocations in config.fish now work. The `fish_user_key_bindings` function is no longer necessary, but will still be executed if it exists (#5191). - `$fish_pid` and `$last_pid` are available as an alternatives to `%self` and `%last`. diff --git a/src/env_universal_common.cpp b/src/env_universal_common.cpp index 517a276ff..2797268f9 100644 --- a/src/env_universal_common.cpp +++ b/src/env_universal_common.cpp @@ -93,6 +93,10 @@ static wcstring get_machine_identifier(); /// return a list of paths where the uvars file has been historically stored. static wcstring_list_t get_legacy_paths(const wcstring &wdir) { wcstring_list_t result; + // A path used during fish 3.0 development. + result.push_back(wdir + L"/fish_universal_variables"); + + // Paths used in 2.x. result.push_back(wdir + L"/fishd." + get_machine_identifier()); wcstring hostname_id; if (get_hostname_identifier(hostname_id)) { @@ -109,7 +113,7 @@ static maybe_t default_vars_path_directory() { static maybe_t default_vars_path() { if (auto path = default_vars_path_directory()) { - path->append(L"/fish_universal_variables"); + path->append(L"/fish_variables"); return path; } return none();