mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 00:13:21 +01:00
bcb7ef48b6
# Description Currently there is a bit of chaos regarding construction of history file paths. Various pieces of code across a number of crates reimplement the same/similar logic: - There is `get_history_path`, but it requires a directory parameter (it really just joins it with a file name). - Some places use a const for the directory parameter, others use a string literal - in all cases the value seems to be `"nushell"`. - Some places assume the `"nushell"` value, other plumb it down from close to the top of the call stack. - Some places use a constant for history file names while others assume it. This PR tries to make it so that the history/config path format is defined in a single places and so dependencies on it are easier to follow: - It removes `get_history_path` and adds a `file_path` method to `HistoryConfig` instead (an extra motivation being, this is a convenient place that can be used from all creates that need a history file path) - Adds a `nu_config_dir` function that returns the nushell configuration directory. - Updates existing code to rely on the above, effectively removing duplicate uses of `"nushell"` and `NUSHELL_FOLDER` and assumptions about file names associated with different history formats # User-Facing Changes None |
||
---|---|---|
.. | ||
mod.rs | ||
test_bits.rs | ||
test_cell_path.rs | ||
test_commandline.rs | ||
test_conditionals.rs | ||
test_config_path.rs | ||
test_config.rs | ||
test_converters.rs | ||
test_custom_commands.rs | ||
test_engine.rs | ||
test_env.rs | ||
test_help.rs | ||
test_hiding.rs | ||
test_ide.rs | ||
test_iteration.rs | ||
test_known_external.rs | ||
test_math.rs | ||
test_modules.rs | ||
test_parser.rs | ||
test_ranges.rs | ||
test_regex.rs | ||
test_signatures.rs | ||
test_spread.rs | ||
test_stdlib.rs | ||
test_strings.rs | ||
test_table_operations.rs | ||
test_type_check.rs | ||
tests.rs |