Refactor xonsh config
This commit is contained in:
10
xonsh/path.xsh
Normal file
10
xonsh/path.xsh
Normal 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")
|
||||
Reference in New Issue
Block a user