mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1375] [CLOSED] feat(core): improve PathExt::replace_env and use it throught the codebase
#1365
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/LGUG2Z/komorebi/pull/1375
Author: @amrbashir
Created: 3/25/2025
Status: ❌ Closed
Base:
master← Head:feat/expand-vars-trait📝 Commits (10+)
803c95efeat(core): add ExpandEnvVars trait to handle environment variable expansion in pathscb16102clippye3d1418var_os9145e3bmove to PathExt7db56b2refactorkomorebiccrate to usePathExt::repalce_env92bedd1refactorkomorebi-barcrate to use PathExt::replace_env8f834eefmt23b8623refactorkomorebicrate to usePathExt::repalce_env5da5564Merge branch 'master' into feat/expand-vars-traite52850aleftovers📊 Changes
12 files changed (+448 additions, -236 deletions)
View changed files
📝
Cargo.lock(+76 -0)📝
komorebi-bar/src/bar.rs(+10 -6)📝
komorebi-bar/src/main.rs(+20 -26)📝
komorebi-client/src/lib.rs(+1 -1)📝
komorebi/Cargo.toml(+1 -0)📝
komorebi/src/core/mod.rs(+42 -51)📝
komorebi/src/core/pathext.rs(+173 -29)📝
komorebi/src/lib.rs(+10 -9)📝
komorebi/src/main.rs(+2 -0)📝
komorebi/src/static_config.rs(+52 -44)📝
komorebi/src/windows_api.rs(+1 -1)📝
komorebic/src/main.rs(+60 -69)📄 Description
This new implementation allows for expanding any environment variable so it is not limited to just
~,$HOME,$Env:USERPROFILEand$Env:KOMOREBI_CONFIG_HOME.It expands the follwing formats:
%variable%$Env:variable$variable.Why?
Just for convenience, for example instead of
$HOME/AppData/Roaming/applications.json, it can be$APPDATA/applications.jsonRemaining questions?
resolve_home_pathfunction be removed? It is not just a wrapper around the new trait.ExpandEnvVars::expand_varsreturn a result when a variable doesn't exit in env or keep the path as is (current behavior)?🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.