Skip to content

Commit

Permalink
Rename $FISH_VERSION back to the original $version.
Browse files Browse the repository at this point in the history
Order is restored in the universe. Fixes #4414
  • Loading branch information
floam committed Oct 14, 2017
1 parent 7be8a17 commit fb8ae04
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc_src/index.hdr.in
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ The user can change the settings of `fish` by changing the values of certain var

- `cmd_duration`, the runtime of the last command in milliseconds.

- `FISH_VERSION`, the version of the currently running fish
- `version`, the version of the currently running fish

- `SHLVL`, the level of nesting of shells

Expand Down
2 changes: 0 additions & 2 deletions share/config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ function __fish_default_command_not_found_handler
echo "fish: Unknown command '$argv'" >&2
end

set -g version $FISH_VERSION

if status --is-interactive
# The user has seemingly explicitly launched an old fish with too-new scripts installed.
if not contains -- "string" (builtin -n)
Expand Down
2 changes: 1 addition & 1 deletion share/functions/fish_indent.fish
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# check if command fish_indent works and is the same version that
# came with this fish. This will happen one time.
command -sq fish_indent
and command fish_indent --version 2>&1 | string match -rq $FISH_VERSION
and command fish_indent --version 2>&1 | string match -rq $version
# if alias doesn't define the function here, this is an autoloaded "nothing".
# the command (if there is one) will be used by default.
or alias fish_indent=(string escape $__fish_bin_dir/fish_indent)
2 changes: 1 addition & 1 deletion share/functions/fish_key_reader.fish
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# check if command fish_key_reader works and is the same version that
# came with this fish. This will happen one time.
command -sq fish_key_reader
and command fish_key_reader --version 2>&1 | string match -q -- $FISH_VERSION
and command fish_key_reader --version 2>&1 | string match -q -- $version
# if alias doesn't define the function here, this is an autoloaded "nothing".
# the command (if there is one) will be used by default.
or alias fish_key_reader=(string escape $__fish_bin_dir/fish_key_reader)
2 changes: 1 addition & 1 deletion share/functions/help.fish
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function help --description 'Show help for the fish shell'
end
else
# Go to the web. Only include one dot in the version string
set -l version_string (echo $FISH_VERSION| cut -d . -f 1,2)
set -l version_string (echo $version| cut -d . -f 1,2)
set page_url https://fishshell.com/docs/$version_string/$fish_help_page
end
Expand Down
4 changes: 2 additions & 2 deletions src/env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ void env_init(const struct config_paths_t *paths /* or NULL */) {
wcstring(L"history"),
wcstring(L"_"),
wcstring(L"PWD"),
wcstring(L"FISH_VERSION") }) {
wcstring(L"version") }) {
env_read_only.emplace(std::move(k));
// L"SHLVL" is readonly but will be inserted below after we increment it.
};
Expand Down Expand Up @@ -926,7 +926,7 @@ void env_init(const struct config_paths_t *paths /* or NULL */) {

// Set up the version variable.
wcstring version = str2wcstring(get_fish_version());
env_set_one(L"FISH_VERSION", ENV_GLOBAL, version);
env_set_one(L"version", ENV_GLOBAL, version);

// Set up SHLVL variable.
const auto shlvl_var = env_get(L"SHLVL");
Expand Down

0 comments on commit fb8ae04

Please sign in to comment.