Refactor xonsh config

This commit is contained in:
2022-01-06 16:50:56 -08:00
parent 33372e8300
commit 68d903d628
9 changed files with 96 additions and 91 deletions

10
xonsh/path.xsh Normal file
View File

@@ -0,0 +1,10 @@
from pathlib import Path
from typing import List
def ensure_path(*paths: List[str]):
for p in paths:
abs_p = str(Path(p).expanduser().absolute())
if abs_p not in $PATH:
$PATH.insert(0, abs_p)
ensure_path("/usr/local/bin", "~/.dotfiles/bin", "~/.local/bin", "~/bin", "~/.emacs.d/bin")